问题
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