【发布时间】:2009-11-19 15:27:27
【问题描述】:
我想从一个常规的 32 位图像对象创建一个 8 位索引图像。
Bitmap img = new Bitmap(imgPath); // 32-bit
Bitmap img8bit = new Bitmap(imgW, imgH, Format8bppIndexed); // 8-bit
// copy img to img8bit -- HOW?
img8bit.Save(imgNewPath, ImageFormat.Png);
我无法使用 SetPixel 逐个像素地复制它,因为 Graphics 不适用于索引图像。
还有什么办法?
【问题讨论】: