Cannot open a .tif with color using .Net Image or Bitmap classes

Posted by Tom Regan on Stack Overflow See other posts from Stack Overflow or by Tom Regan
Published on 2010-03-18T17:37:28Z Indexed on 2010/03/19 17:51 UTC
Read the original article Hit count: 184

Filed under:
|
|
|

I am attempting to open .tif files that have color in them (300 dpi, PixelFormat.Format24bppRgb) using the .Net Image and Bitmap classes. I always get an "invalid parameter" error when the tiffs have color (works fine for black and white tiffs). If anyone has source code on how to open a .tif with color in it I'd deeply appreciate it. Below is what I'm attempting to do; this also fails when calling Bitmap.FromStream:

using (FileStream fs = File.OpenRead(fileName))
{
    using (Image img = Image.FromStream(fs)) {}
}

© Stack Overflow or respective owner

Related posts about image

Related posts about bitmap