Selects a frame specified by dimension and index. Throws an exception if the frame does not exist.
Syntax

[C#]

void SelectActiveFrame(FrameDimension dimension, int index);

[Visual Basic]

Sub SelectActiveFrame(dimension As FrameDimension, index As Integer)
Params
Name Description
dimension The type of frame to make active.
index The zero based index of the frame.
Notes

None.

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#]using (Image bm = Bitmap.FromFile(Server.MapPath("rez/layers2.psd"))) {
  int count = bm.GetFrameCount(FrameDimension.Page);
  for (int i = 0; i < count; i++) {
    bm.SelectActiveFrame(FrameDimension.Page, i);
    bm.Save(Server.MapPath($"IG8_Image_SelectActiveFrame{i + 1}.png"));
  }
}



IG8_Image_SelectActiveFrame1.png


IG8_Image_SelectActiveFrame2.png


IG8_Image_SelectActiveFrame3.png


IG8_Image_SelectActiveFrame4.png