Extracting Pages from Multipage TIFF

  • Thread starter Thread starter Curtis Justus
  • Start date Start date
C

Curtis Justus

Hi,

I am reading in a multipage TIFF image and need to manipulate each page
separately. After reading the image into an Image object, I set the page by
using the SelectActiveFrame method. Then, I am converting it to an
individual Bitmap/Image. Here is a sample:
----------------------
FrameDimension fd = _image.SetActiveFrame(fd, 0);

Bitmap bmp = new Bitmap(_image);

/* Do what I need to with bmp... */
--------------

The problem is that this seems to eat up more memory than I expected. I'm
guessing that is because the PixelFormat on bmp is set to 32 bit instead of
1 bit (the native pixel format). So, I tried to do this:

--------------
Bitmap bmp = new Bitmap(_image.Height, _image.Width, _image.PixelFormat);
bmp = (Bitmap)_image;
bmp.SetResolution(_image.HorizontalResolution, _image.VerticalResolution);
--------------

Is this the best way of doing it?

Thanks,
cj
 
Back
Top