Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有两个索引(8 位)Bitamp,都在 C#(.NET Framework 2.0)中使用相同的调色板。我想在指定坐标上将像素从一个复制到另一个。我曾尝试使用 Graphics 类,但得到它不适用于索引颜色的异常,我也尝试使用 getpixel()/setpixel() 但得到相同的异常。它不需要很快它只需要工作。而且我不能转换为非索引图像,反之亦然 - 调色板对我来说非常重要,我不能丢失任何有关它的信息。
您可以使用http://www.imagemagick.org/script/api.php
GDI+ 对索引格式的支持很差。Vista 的情况变得更好,其中包括将 gdiplus.dll 更新到 1.10 版。我想不到你应该做的任何事情。您可以破解 Bitmap.Lock(),处理单字节/像素格式是可行的。但是我会说将这些图像转换为 24 或 32bpp 格式。