J
johnb41
I need to use the bitmap.getpixel method to work on the pixel level of
an image. But GetPixel will not work with Indexed images. The images
that i work with are black & white text scans.
I create the bitmap object like this:
Dim b As Bitmap = Bitmap.FromFile("c:\scan.tif")
But I want to convert this file to PixelFormat.Format24bppRgb (or
something NOT indexed)
PixelFormat.Format24bppRgb is Read Only, so i can't simply do:
b.pixelFormat = PixelFormat.Format24bppRgb
Bitmap has an overload that allows the Pixelformat to be specified, but
the overload cannot accept a file name for my tiff, just a width and
height. If I use that overload, my bitmap object ends up blank. I
need it to hold image data.
I'm totally stumped. Can anyone help?
Thanks!
John
an image. But GetPixel will not work with Indexed images. The images
that i work with are black & white text scans.
I create the bitmap object like this:
Dim b As Bitmap = Bitmap.FromFile("c:\scan.tif")
But I want to convert this file to PixelFormat.Format24bppRgb (or
something NOT indexed)
PixelFormat.Format24bppRgb is Read Only, so i can't simply do:
b.pixelFormat = PixelFormat.Format24bppRgb
Bitmap has an overload that allows the Pixelformat to be specified, but
the overload cannot accept a file name for my tiff, just a width and
height. If I use that overload, my bitmap object ends up blank. I
need it to hold image data.
I'm totally stumped. Can anyone help?
Thanks!
John