לחיתוך קובץ PSD בעת המרתו ל- PNG

בקוד דוגמה שסופק להלן מדגיש איך לחתוך את התמונה PSD בעת המרתה ל- PNG.

// For complete examples and data files, please go to https://github.com/aspose-psd/Aspose.PSD-for-.NET
string sourceFileName = dataDir + "1.psd";
string exportPathPsd = dataDir + "CropTest.psd";
string exportPathPng = dataDir + "CropTest.png";
using (RasterImage image = Image.Load(sourceFileName) as RasterImage)
{
image.Crop(new Rectangle(10, 30, 100, 100));
image.Save(exportPathPsd, new PsdOptions());
image.Save(exportPathPng, new PngOptions() { ColorType = PngColorType.TruecolorWithAlpha });
}