【发布时间】:2014-01-08 21:54:15
【问题描述】:
我有一个正在执行着色转换的位图。我有新的像素数组,但我不确定如何将它们作为图像保存回磁盘
public static void TestProcessBitmap(string inputFile, string outputFile)
{
Bitmap bitmap = new Bitmap(inputFile);
Bitmap formatted = bitmap.Clone(new Rectangle(0, 0, bitmap.Width, bitmap.Height), System.Drawing.Imaging.PixelFormat.Format8bppIndexed);
byte[] pixels = BitmapToPixelArray(formatted);
pixels = Process8Bits(pixels, System.Windows.Media.Colors.Red);
Bitmap output = new Bitmap(pixels); //something like this
}
然后如何将新像素保存为磁盘上的位图?
【问题讨论】:
-
记得妥善处理您的位图。 stackoverflow.com/questions/5838608/…