Type Default Value Read Only Static Description
Int64 1 No No The current image frame.
Notes

For movies and multi-frame images this property indicates the currently selected frame. As you change this property, image width, height, bounding box and resolution may also change.

See Also

Time

FrameCount

Example

Here we load a Photoshop file and save all layers as png. Note that the first layer is a composition of all layers.

[C#]Canvas canvas = new Canvas();
XImage image = XImage.FromFile(Server.MapPath("rez/layers.psd"));
DrawOptions drawOpts = new DrawOptions();
for (int i = 1; i <= image.FrameCount; i++) {
  canvas.Clear();
  image.Frame = i;
  canvas.DrawImage(image, drawOpts);
  canvas.SaveAs(Server.MapPath(string.Format
    ("XImage_Frame_86_Frame{0}.png", i)));
}      


[Visual Basic]Dim canvas As New Canvas()
Dim image As XImage = XImage.FromFile(Server.MapPath("rez/layers.psd"))
Dim drawOpts As New DrawOptions()
For i As Integer = 1 To image.FrameCount
  canvas.Clear()
  image.Frame = i
  canvas.DrawImage(image, drawOpts)
  canvas.SaveAs(Server.MapPath(String.Format("XImage_Frame_86_Frame{0}.png", i)))
Next



XImage_Frame_86_Frame1.png


XImage_Frame_86_Frame2.png


XImage_Frame_86_Frame3.png


XImage_Frame_86_Frame4.png