Here is some sample code
This will get you the number of frames in the TIF image
as well as display them one by one in a picturebox
Dim FName As String
Dim pic As Image
Dim frameCount As Integer
Dim iFrame As Integer
' Get the complete TIF into an object
FName = "c:\somepath\somefile.tif"
pic = Image.FromFile( FName )
' Count the frames
frameCount = pic.GetFrameCount( Imaging.FrameDimension.Page )
MsgBox("there are " & frameCount.ToString & " frames")
' Process one frame at a time - display and convert to GIF
For iFrame = 0 To frameCount - 1
' get current frame
pic.SelectActiveFrame( Imaging.FrameDimension.Page, iFrame )
PictureBox1.Image = New Bitmap( pic )
MsgBox("Showing Frame #" & iFrame.ToString )
Next
Does this meet your needs ?
* * Please include a copy of this message with your reply
Jeff Bennett
Jeff @ Bennet-Tec.Com
* Bennet-Tec Information Systems, Inc
* 50 Jericho Tpk, Jericho, NY 11753
* Phone 516 997 5596, Fax - 5597
* RELIABLE Components Make You Look Sharp!
* TList/Pro * ALLText HT/Pro * MetaDraw *
* Custom Software Development Services Too.
* WWW.Bennet-Tec.Com
=================== ===================
[quoted text, click to view] "zamdrist@gmail.com" wrote:
> Trying to determine the number of pages in a tiff file. I'm assuming
> System.Drawing calls pages frames.
>
> Here's what I have now, although it clearly doesn't work:
>
> Dim img As Image
> Dim dimen As Guid()
>
> img = Image.FromFile("C:\eofb_396.tif")
> dimen = img.FrameDimensionsList
>
> MsgBox(dimen.GetUpperBound(0))
>
>
> Ideas? Thoughts? I'm digging into the System.Drawing & Imaging
> constructs.
>
> Thanks!
>