XImage Frame Property. The currently selected frame. ABCpdf .NET PDF Library.

ABCpdf .net

 
   

 

Type Default Read Only Description
[C#] int

[Visual Basic]
Integer
1 No The currently selected frame.

 

   

Notes
 

Some file formats can contain more than one image. The FrameCount property reflects the number of images.

You can change the currently selected image using the Frame property. As you change the frame the Width, Height, HRes and VRes properties will change to reflect the dimensions and resolution of the currently selected image. When you add an Image using the Doc.AddImageObject method the currently selected frame is added.

Flash (SWF) movies contain a number of frames. You can set the current frame using this property. If you set this property to a negative number it indicates the number of milliseconds (rather than frames) into the movie.

 

   

Example
 
Here we open a TIFF file using the XImage object. We then scan through each of the images within the file and insert them into a new page of our PDF document.

[C#]
XImage theImg = new XImage();
Doc theDoc = new Doc();
theImg.SetFile(Server.MapPath("../mypics/multipage.tif"));
for (int i = 1; i <= theImg.FrameCount; i++) {
  theImg.Frame = i;
  theDoc.Page = theDoc.AddPage();
  theDoc.AddImageObject(theImg, false);
}
theImg.Clear();
theDoc.Save(Server.MapPath("imageframe.pdf"));
theDoc.Clear();

[Visual Basic]
Dim theImg As XImage = New XImage()
Dim theDoc As Doc = New Doc()
theImg.SetFile(Server.MapPath("../mypics/multipage.tif"))
For i As Integer = 1 To theImg.FrameCount
  theImg.Frame = i
  theDoc.Page = theDoc.AddPage()
  theDoc.AddImageObject(theImg, False)
Next
theImg.Clear()
theDoc.Save(Server.MapPath("imageframe.pdf"))
theDoc.Clear()


imageframe.pdf - [Page 1]


imageframe.pdf - [Page 2]