Bitmap with alpha channel crashes Bitmap () constructor only under Windows 7

人走茶凉 提交于 2019-12-25 06:50:19

问题


Ran into a weird Bitmap problem that I can't find in Google:

The Bitmap constructor crashes on a file with an alpha channel under Windows 7, but works perfectly under Windows XP.

The code couldn't be simpler:

Bitmap image = new Bitmap (fname);

The error is: "Parameter is not valid", and there's no inner exception.

If it failed in Windows XP too, I'd suspect a simple bug, but since it works there it implies it's something more complex.

Any ideas how a bitmap with an alpha channel can be loaded under Windows 7? Thanks!


回答1:


SOLVED: The .NET Bitmap class seems to fail reading a CMYK TIFF file with an alpha channel under Windows 7, 64-bit. The workaround is to use an Aurigma Bitmap, which (unlike a .NET Bitmap) can handle CMYK images with or without an alpha channel.

The Aurigma Bitmap is available from www.aurigma.com , and is compatible with .NET.



来源:https://stackoverflow.com/questions/9623355/bitmap-with-alpha-channel-crashes-bitmap-constructor-only-under-windows-7

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