Timeline.SwitchActiveFrame
Timeline.SwitchActiveFrame method
Switches the active frame to targeted.
public void SwitchActiveFrame(int targetActiveFrameIndex)
Parameter | Type | Description |
---|---|---|
targetActiveFrameIndex | Int32 | The target frame index. |
Exceptions
exception | condition |
---|---|
IndexOutOfRangeException | The new index of the active frame should be in the frame count range. |
Examples
The following code demonstrates a new approach to work with the Timeline.
[C#]
string sourceFile = "4_animated.psd";
string outputFile = "output_edited.psd";
using (var psdImage = (PsdImage)Image.Load(sourceFile))
{
Timeline timeline = psdImage.Timeline;
// Add one more frame
List<Frame> frames = new List<Frame>(timeline.Frames);
frames.Add(new Frame());
timeline.Frames = frames.ToArray();
timeline.SwitchActiveFrame(4);
psdImage.Save(outputFile);
}
See Also
- class Timeline
- namespace Aspose.PSD.FileFormats.Psd.Layers.Animation
- assembly Aspose.PSD