Represents a PSD layer.
Namespace:
Aurigma.GraphicsMill.Codecs.Psd
Assembly:
Aurigma.GraphicsMill (in Aurigma.GraphicsMill.dll)
public class PsdFrame : Frame
The following code opens a PSD file, iterates through its layers, and saves bitmaps from the raster layers to separate PNG files:
//create PSD reader
using (var reader = new PsdReader(@"Images\BusinessCard.psd"))
{
//read layers and save raster layers in PNG files
for (int i = 0; i < reader.Frames.Count; i++)
{
using (var frame = reader.Frames[i])
{
Console.WriteLine("Frame " + frame.Index + " is processing. Frame type is " + frame.Type + ".");
if (frame.Type == FrameType.Raster)
{
using (var bitmap = frame.GetBitmap())
{
bitmap.Save(@"Images\Output\frame_" + i + ".png");
}
}
}
}
}