How can I debug misleading GDI OutOfMemory exceptions?

放肆的年华 提交于 2019-12-06 22:30:28
Alex F

From Graphics.FromImage Method definition:

If the image has an indexed pixel format, this method throws an exception with the message, "A Graphics object cannot be created from an image that has an indexed pixel format."

Though exception you get is really misleading, you are trying to execute unsupported operation. It looks like you need to resize this bitmap as raw memory block, and not as GDI+ bitmap.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!