我希望WMF
仅通过一种颜色从图像文件中删除所有颜色。
Metafile img = new Metafile(path + strFilename + ".wmf");
float planScale = 0.06615f;
float scale = 1200f / (float)img.Width;
planScale = planScale / scale; ;
float widht = img.Width * scale;
float height = img.Height * scale;
using (var target = new Bitmap((int)widht, (int)height))
{
using (var g = Graphics.FromImage(target))
{
g.DrawImage(img, 0, 0, (int)widht, (int)height);
target.Save("image.png", ImageFormat.Png);
}
}
目前,我加载一个WMF
文件,设置比例并将其保存为PNG
文件。
但现在我需要删除所有颜色(绿色、紫色......)并只设置一种颜色,例如灰色。