C# ile PSD Görüntüsünün Raster Biçimine Dönüştürülmesi
Genel Bakış
Aspose.PSD, PSD ve PSB biçimlerini JPEG, JPEG2000, PNG, TIFF, PDF, GIF ve BMP biçimlerine dönüştürmeyi sağlar.
Aspose.PSD ile sunucunuzda PSD dosyalarını dönüştürebilirsiniz ve bunu Photoshop olmadan yapabilirsiniz. Adobe Photoshop betiklerinin yerine kullanabileceğiniz iyi bir alternatiftir, çünkü Adobe’nin EULA’sı bir sunucuda Uygulamayı kullanmayı ve UI’sını değiştirmeyi yasaklar. Ancak PSD Format SDK ile PSD Dosyalarının toplu dönüşümünü yapabilirsiniz. PSD biçimli dışa aktarımınız, Salt Okunur mod ile mükemmel pikselli olabilir veya katmanları, metinleri, efektleri değiştirebilir ve ardından dışa aktarım yapabilirsiniz.
PSD’nin Raster Biçimlere Dönüştürülmesine Özel Örnekler
Çeşitli raster dosya biçimlerine PSD görüntüsünün dışa aktarılması
Aşağıdaki örnek kod, PSD’yi çeşitli raster dosya biçimlerine dönüştürmenin nasıl yapılacağını göstermektedir.
// For complete examples and data files, please go to https://github.com/aspose-psd/Aspose.PSD-for-.NET | |
string srcPath = dataDir + @"sample.psd"; | |
string destName = dataDir + @"export"; | |
// Load an existing PSD image as Image | |
using (Image image = Image.Load(srcPath)) | |
{ | |
// Create an instance of PngOptions class | |
PngOptions pngOptions = new PngOptions(); | |
// Create an instance of BmpOptions class | |
BmpOptions bmpOptions = new BmpOptions(); | |
// Create an instance of TiffOptions class | |
TiffOptions tiffOptions = new TiffOptions(FileFormats.Tiff.Enums.TiffExpectedFormat.Default); | |
// Create an instance of GifOptions class | |
GifOptions gifOptions = new GifOptions(); | |
// Create an instance of JpegOptions class | |
JpegOptions jpegOptions = new JpegOptions(); | |
// Create an instance of Jpeg2000Options class | |
Jpeg2000Options jpeg2000Options = new Jpeg2000Options(); | |
// Call the save method, provide output path and export options to convert PSD file to various raster file formats. | |
image.Save(destName + ".png", pngOptions); | |
image.Save(destName + ".bmp", bmpOptions); | |
image.Save(destName + ".tiff", tiffOptions); | |
image.Save(destName + ".gif", gifOptions); | |
image.Save(destName + ".jpeg", jpegOptions); | |
image.Save(destName + ".jp2", jpeg2000Options); | |
} |