multipage tiff

  • Thread starter Thread starter Al
  • Start date Start date
Al said:
Is it possible, using only VB.NET code, to extract a single page from a
multipage tiff file?

Yes, it is possible. For example, you can load a multipage tiff image into an image object and select page using the
SelectActiveFrame method in the image object.

Dim img As Image
Dim bmp As Image

img = Image.FromFile(OpenFileDialog1.FileName)
intCurrPage = 2 'Select page 2
intNumPages = img.GetFrameCount(Imaging.FrameDimension.Page)
img.SelectActiveFrame(System.Drawing.Imaging.FrameDimension.Page, intCurrPage - 1)
bmp = New Bitmap(img, PictureBox1.Width, PictureBox1.Height)

bmp now holds the selected page.
 
Looks promising, but I am uncertain as to the proper values of
PictureBox1.Width and PictureBox1.Height. Does it matter?

I should have mentioned, this code will be part of a web service that
will return a file(page) as a bytearray to the calling client
application.

Thanks for your kind response.


*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
 
Back
Top