积极答复者
c# 能否读取保存位深度为16位的png图片

问题
答案
-
你好:
欢迎来到MSDN中文论坛!
你是如何保存这个图片的?我在我的64位Win8下通过如下代码创建的图片深度确实是48位的:
Bitmap img = new Bitmap(100, 100, PixelFormat.Format48bppRgb); img.Save("img.png");
PixelFormat枚举确实有16位的选项,但是创建出来的图片都是32位的,有可能是GDI+不支持,也有可能是你的显卡不支持。
另外请参考这篇帖子:
Reading/preserving a PixelFormat.Format48bppRgb PNG Bitmap in .NET?
如果还是不行的话,可以参考上面这个帖子里面的答案中的方法,就是通过System.Windows.Media.Imaging类来创建图片,而不是Bitmap类。
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click HERE to participate the survey.
- 已编辑 CaillenModerator 2013年11月7日 9:18 edit
- 已标记为答案 CaillenModerator 2013年11月18日 13:44
全部回复
-
可以上传你的代码以及你的48位的图片我们来看看额?请提供公开下载地址(您可以用网盘)公布地址。包含完整模拟问题的项目和图片。谢谢!
For Account Validation, please follow "Verify Account+Number" at http://social.msdn.microsoft.com/Forums/en-us/home?forum=reportabug
For ASP.NET Question, please ask at http://forums.asp.net
For other questions, you can find a specific forum and then ask at http://stackexchange.com/sites
Click and Donate at http://www.freerice.com -
你好:
欢迎来到MSDN中文论坛!
你是如何保存这个图片的?我在我的64位Win8下通过如下代码创建的图片深度确实是48位的:
Bitmap img = new Bitmap(100, 100, PixelFormat.Format48bppRgb); img.Save("img.png");
PixelFormat枚举确实有16位的选项,但是创建出来的图片都是32位的,有可能是GDI+不支持,也有可能是你的显卡不支持。
另外请参考这篇帖子:
Reading/preserving a PixelFormat.Format48bppRgb PNG Bitmap in .NET?
如果还是不行的话,可以参考上面这个帖子里面的答案中的方法,就是通过System.Windows.Media.Imaging类来创建图片,而不是Bitmap类。
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click HERE to participate the survey.
- 已编辑 CaillenModerator 2013年11月7日 9:18 edit
- 已标记为答案 CaillenModerator 2013年11月18日 13:44