اعمال ماسک
Contents
[
Hide
]
پشتیبانی از لایه ماسک
این مقاله نحوه پشتیبانی از لایه ماسک برای تصاویر PSD را نشان میدهد و پس از آن تصاویر را ذخیره میکند. کد قطعهای زیر ارائه شده است.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String dataDir = Utils.getDataDir(SupportOfLayerMask.class) + "PSD/"; | |
// Export of the psd with complex mask | |
String sourceFileName = dataDir + "MaskComplex.psd"; | |
String exportPath = dataDir + "MaskComplex.png"; | |
try (PsdImage im = (PsdImage) Image.load(sourceFileName)) { | |
// Export to PNG | |
PngOptions saveOptions = new PngOptions(); | |
saveOptions.setColorType(PngColorType.TruecolorWithAlpha); | |
im.save(exportPath, saveOptions); | |
} |
پشتیبانی از ماسک کلیپکردن
این مقاله نحوه پشتیبانی از ماسک کلیپکردن در یک فایل PSD با Aspose.PSD را نشان میدهد. کد قطعهای زیر ارائه شده است.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String dataDir = Utils.getDataDir(SupportOfClippingMask.class) + "PSD/"; | |
// Exposure layer editing | |
// Export of the psd with complex clipping mask | |
String sourceFileName = dataDir + "ClippingMaskComplex.psd"; | |
String exportPath = dataDir + "ClippingMaskComplex.png"; | |
try (PsdImage im = (PsdImage) Image.load(sourceFileName)) { | |
// Export to PNG | |
PngOptions saveOptions = new PngOptions(); | |
saveOptions.setColorType(PngColorType.TruecolorWithAlpha); | |
im.save(exportPath, saveOptions); | |
} |