Extracting Pages from Multipage TIFF

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top