请问如何用C#实现:将24位bitmap图像转换成8位bitmap图像?

sjl103 2012-08-06 03:22:23
24位的Bmp图转成8位Bmp如何尽量做到质量一致?不是灰度,尽量减少失真

...全文
448 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
sjl103 2012-08-08
  • 打赏
  • 举报
回复
都没人呢?
sjl103 2012-08-07
  • 打赏
  • 举报
回复
求解释
isjoe 2012-08-06
  • 打赏
  • 举报
回复

ImageCodecInfo[] MyInfos = ImageCodecInfo.GetImageEncoders();
ImageCodecInfo InfoPNG = MyInfos[0];
for (int i = 0; i < MyInfos.Length; i++)
{
if (MyInfos[i].FormatDescription == "PNG ")
{
InfoPNG = MyInfos[i];
}
}
System.Drawing.Imaging.Encoder MyEncoder = System.Drawing.Imaging.Encoder.ColorDepth;
EncoderParameters MyParams = new EncoderParameters();
EncoderParameter MyParam = new EncoderParameter(MyEncoder, 8L);
MyParams.Param[0] = MyParam;
Bitmap.Save(文件名, InfoPNG, MyParams);

111,120

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • AIGC Browser
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧