Class PsdOptions

Class PsdOptions

نام ها : Aspose.Imaging.ImageOptions جمع آوری: Aspose.Imaging.dll (25.4.0)

ایجاد تصاویر Photoshop Document (PSD) با API ما، ارائه گزینه های متنوعبا فرمت های مختلف، روش های فشرده سازی، حالت های رنگی وبیتی ها در هر کانال رنگی شمارش می شوند و به راحتی با کانتینر های متادیت XMP برخورد می کنند.اطمینان از پردازش کامل تصویر با قدرت ویژگی های فرمت PSDمانند لایه های تصویر، ماسک های لایه و اطلاعات فایل برای سفارشی سازیخلاقیت در طراحی های شما

[JsonObject(MemberSerialization.OptIn)]
public class PsdOptions : ImageOptionsBase, IDisposable, IHasXmpData, IHasMetadata, ICloneable

Inheritance

object DisposableObject ImageOptionsBase PsdOptions

Implements

IDisposable , IHasXmpData , IHasMetadata , ICloneable

اعضای ارثی

ImageOptionsBase.Clone() , ImageOptionsBase.ReleaseManagedResources() , ImageOptionsBase.KeepMetadata , ImageOptionsBase.XmpData , ImageOptionsBase.Source , ImageOptionsBase.Palette , ImageOptionsBase.ResolutionSettings , ImageOptionsBase.VectorRasterizationOptions , ImageOptionsBase.BufferSizeHint , ImageOptionsBase.MultiPageOptions , ImageOptionsBase.FullFrame , ImageOptionsBase.ProgressEventHandler , DisposableObject.Dispose() , DisposableObject.ReleaseManagedResources() , DisposableObject.ReleaseUnmanagedResources() , DisposableObject.VerifyNotDisposed() , DisposableObject.Disposed , object.GetType() , object.MemberwiseClone() , object.ToString() , object.Equals(object?) , object.Equals(object?, object?) , object.ReferenceEquals(object?, object?) , object.GetHashCode()

Examples

این مثال نشان دهنده استفاده از Aspsoe.Imaging برای .Net API برای تبدیل تصاویر به فرمت PSD است. برای رسیدن به این هدف این مثال یک تصویر موجود را بارگذاری می کند و سپس آن را به فرمت PSD ذخیره می کند.

string dir = "c:\\temp\\";

                                                                                                                                                                                                            //Creates an instance of image class and initialize it with an existing file through File path
                                                                                                                                                                                                            using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(dir + "sample.bmp"))
                                                                                                                                                                                                            {
                                                                                                                                                                                                                //Create an instance of PsdOptions class
                                                                                                                                                                                                                Aspose.Imaging.ImageOptions.PsdOptions psdOptions = new Aspose.Imaging.ImageOptions.PsdOptions();

                                                                                                                                                                                                                //Set the CompressionMethod as RLE
                                                                                                                                                                                                                //Note: Other supported CompressionMethod is CompressionMethod.RAW [No Compression]
                                                                                                                                                                                                                psdOptions.CompressionMethod = Aspose.Imaging.FileFormats.Psd.CompressionMethod.RLE;

                                                                                                                                                                                                                //Set the ColorMode to GrayScale
                                                                                                                                                                                                                //Note: Other supported ColorModes are ColorModes.Bitmap and ColorModes.RGB
                                                                                                                                                                                                                psdOptions.ColorMode = Aspose.Imaging.FileFormats.Psd.ColorModes.Grayscale;

                                                                                                                                                                                                                //Save the image to disk location with supplied PsdOptions settings
                                                                                                                                                                                                                image.Save(dir + "output.psd", psdOptions);
                                                                                                                                                                                                            }

مثال زیر نشان می دهد که چگونه یک تصویر چند صفحه وکتور را به فرمت PSD به طور کلی بدون اشاره به یک نوع تصویر خاص تبدیل کنیم.

string dir = "C:\\aspose.imaging\\net\\misc\\ImagingReleaseQATester\\Tests\\testdata\\2548";
                                                                                                                                                           string inputFilePath = System.IO.Path.Combine(dir, "Multipage.cdr");
                                                                                                                                                           string outputFilePath = System.IO.Path.Combine(dir, "Multipage.cdr.psd");

                                                                                                                                                           Aspose.Imaging.ImageOptionsBase exportOptions = new Aspose.Imaging.ImageOptions.PsdOptions();

                                                                                                                                                           using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(inputFilePath))
                                                                                                                                                           {
                                                                                                                                                               exportOptions.MultiPageOptions = null;

                                                                                                                                                               // Export only first two pages. These pages will be presented as layers in the output PSD.
                                                                                                                                                               Aspose.Imaging.IMultipageImage multipageImage = image as Aspose.Imaging.IMultipageImage;
                                                                                                                                                               if (multipageImage != null && (multipageImage.Pages != null && multipageImage.PageCount > 2))
                                                                                                                                                               {
                                                                                                                                                                   exportOptions.MultiPageOptions = new Aspose.Imaging.ImageOptions.MultiPageOptions(new Aspose.Imaging.IntRange(0, 2));
                                                                                                                                                               }

                                                                                                                                                               if (image is Aspose.Imaging.VectorImage)
                                                                                                                                                               {
                                                                                                                                                                   exportOptions.VectorRasterizationOptions = (Aspose.Imaging.ImageOptions.VectorRasterizationOptions)image.GetDefaultOptions(new object[] { Aspose.Imaging.Color.White, image.Width, image.Height });
                                                                                                                                                                   exportOptions.VectorRasterizationOptions.TextRenderingHint = Aspose.Imaging.TextRenderingHint.SingleBitPerPixel;
                                                                                                                                                                   exportOptions.VectorRasterizationOptions.SmoothingMode = Aspose.Imaging.SmoothingMode.None;
                                                                                                                                                               }

                                                                                                                                                               image.Save(outputFilePath, exportOptions);
                                                                                                                                                           }

Constructors

PsdOptions()

شروع یک مثال جدید از کلاس Aspose.Imaging.ImageOptions.PsdOptions.

[JsonConstructor]
public PsdOptions()

PsdOptions(PsdOptions)

شروع یک مثال جدید از کلاس Aspose.Imaging.ImageOptions.PsdOptions.

public PsdOptions(PsdOptions options)

Parameters

options PsdOptions

گزینه ها را

Properties

ChannelBitsCount

دریافت و یا تنظیم بیت ها شمارش در هر کانال رنگی.

public short ChannelBitsCount { get; set; }

ارزش املاک

short

Examples

این مثال نشان می دهد که چگونه یک تصویر PNG را به فرمت PSD با استفاده از گزینه های مختلف خاص PSD ذخیره کنید.

string dir = "c:\\temp\\";

                                                                                                       // Create a PNG image of 100x100 px.
                                                                                                       using (Aspose.Imaging.FileFormats.Png.PngImage pngImage = new Aspose.Imaging.FileFormats.Png.PngImage(100, 100, Aspose.Imaging.FileFormats.Png.PngColorType.TruecolorWithAlpha))
                                                                                                       {
                                                                                                           // Define a linear blue-transparent gradient.
                                                                                                           Aspose.Imaging.Brushes.LinearGradientBrush gradientBrush = new Aspose.Imaging.Brushes.LinearGradientBrush(
                                                                                                                   new Aspose.Imaging.Point(0, 0),
                                                                                                                   new Aspose.Imaging.Point(pngImage.Width, pngImage.Height),
                                                                                                                   Aspose.Imaging.Color.Blue,
                                                                                                                   Aspose.Imaging.Color.Transparent);

                                                                                                           Aspose.Imaging.Graphics graphics = new Aspose.Imaging.Graphics(pngImage);

                                                                                                           // Fill the PNG image with the linear blue-transparent gradient.
                                                                                                           graphics.FillRectangle(gradientBrush, pngImage.Bounds);

                                                                                                           // The following options will be used to save the PNG image to PSD format.
                                                                                                           Aspose.Imaging.ImageOptions.PsdOptions saveOptions = new Aspose.Imaging.ImageOptions.PsdOptions();

                                                                                                           // The number of bits per channel
                                                                                                           saveOptions.ChannelBitsCount = 8;

                                                                                                           // The number of channels. One channel for each color component R,G,B,A
                                                                                                           saveOptions.ChannelsCount = 4;

                                                                                                           // The color mode
                                                                                                           saveOptions.ColorMode = Aspose.Imaging.FileFormats.Psd.ColorModes.Rgb;

                                                                                                           // No compression
                                                                                                           saveOptions.CompressionMethod = Imaging.FileFormats.Psd.CompressionMethod.Raw;

                                                                                                           // Default version is 6
                                                                                                           saveOptions.Version = 6;            

                                                                                                           using (System.IO.FileStream stream = System.IO.File.Create(dir + "saveoptions.psd"))
                                                                                                           {
                                                                                                               pngImage.Save(stream, saveOptions);
                                                                                                               System.Console.WriteLine("The size of the PSD image with RAW compression: {0}", stream.Length);
                                                                                                           }

                                                                                                           using (System.IO.FileStream stream = System.IO.File.Create(dir + "saveoptions.RLE.psd"))
                                                                                                           {
                                                                                                               // The RLE compression allows to reduce the size of the output image
                                                                                                               saveOptions.CompressionMethod = Imaging.FileFormats.Psd.CompressionMethod.RLE;

                                                                                                               pngImage.Save(stream, saveOptions);
                                                                                                               System.Console.WriteLine("The size of the PSD image with RLE compression: {0}", stream.Length);
                                                                                                           }

                                                                                                           // The output may look like this:
                                                                                                           // The size of the PSD image with RAW compression: 40090
                                                                                                           // The size of the PSD image with RLE compression: 16185
                                                                                                       }

ChannelsCount

دریافت و یا تنظیم کانال های رنگی شمارش.

public short ChannelsCount { get; set; }

ارزش املاک

short

Examples

این مثال نشان می دهد که چگونه یک تصویر PNG را به فرمت PSD با استفاده از گزینه های مختلف خاص PSD ذخیره کنید.

string dir = "c:\\temp\\";

                                                                                                       // Create a PNG image of 100x100 px.
                                                                                                       using (Aspose.Imaging.FileFormats.Png.PngImage pngImage = new Aspose.Imaging.FileFormats.Png.PngImage(100, 100, Aspose.Imaging.FileFormats.Png.PngColorType.TruecolorWithAlpha))
                                                                                                       {
                                                                                                           // Define a linear blue-transparent gradient.
                                                                                                           Aspose.Imaging.Brushes.LinearGradientBrush gradientBrush = new Aspose.Imaging.Brushes.LinearGradientBrush(
                                                                                                                   new Aspose.Imaging.Point(0, 0),
                                                                                                                   new Aspose.Imaging.Point(pngImage.Width, pngImage.Height),
                                                                                                                   Aspose.Imaging.Color.Blue,
                                                                                                                   Aspose.Imaging.Color.Transparent);

                                                                                                           Aspose.Imaging.Graphics graphics = new Aspose.Imaging.Graphics(pngImage);

                                                                                                           // Fill the PNG image with the linear blue-transparent gradient.
                                                                                                           graphics.FillRectangle(gradientBrush, pngImage.Bounds);

                                                                                                           // The following options will be used to save the PNG image to PSD format.
                                                                                                           Aspose.Imaging.ImageOptions.PsdOptions saveOptions = new Aspose.Imaging.ImageOptions.PsdOptions();

                                                                                                           // The number of bits per channel
                                                                                                           saveOptions.ChannelBitsCount = 8;

                                                                                                           // The number of channels. One channel for each color component R,G,B,A
                                                                                                           saveOptions.ChannelsCount = 4;

                                                                                                           // The color mode
                                                                                                           saveOptions.ColorMode = Aspose.Imaging.FileFormats.Psd.ColorModes.Rgb;

                                                                                                           // No compression
                                                                                                           saveOptions.CompressionMethod = Imaging.FileFormats.Psd.CompressionMethod.Raw;

                                                                                                           // Default version is 6
                                                                                                           saveOptions.Version = 6;            

                                                                                                           using (System.IO.FileStream stream = System.IO.File.Create(dir + "saveoptions.psd"))
                                                                                                           {
                                                                                                               pngImage.Save(stream, saveOptions);
                                                                                                               System.Console.WriteLine("The size of the PSD image with RAW compression: {0}", stream.Length);
                                                                                                           }

                                                                                                           using (System.IO.FileStream stream = System.IO.File.Create(dir + "saveoptions.RLE.psd"))
                                                                                                           {
                                                                                                               // The RLE compression allows to reduce the size of the output image
                                                                                                               saveOptions.CompressionMethod = Imaging.FileFormats.Psd.CompressionMethod.RLE;

                                                                                                               pngImage.Save(stream, saveOptions);
                                                                                                               System.Console.WriteLine("The size of the PSD image with RLE compression: {0}", stream.Length);
                                                                                                           }

                                                                                                           // The output may look like this:
                                                                                                           // The size of the PSD image with RAW compression: 40090
                                                                                                           // The size of the PSD image with RLE compression: 16185
                                                                                                       }

ColorMode

حالت رنگی PSD را دریافت یا تنظیم کنید.

public ColorModes ColorMode { get; set; }

ارزش املاک

ColorModes

Examples

این مثال نشان دهنده استفاده از Aspsoe.Imaging برای .Net API برای تبدیل تصاویر به فرمت PSD است. برای رسیدن به این هدف این مثال یک تصویر موجود را بارگذاری می کند و سپس آن را به فرمت PSD ذخیره می کند.

string dir = "c:\\temp\\";

                                                                                                                                                                                                            //Creates an instance of image class and initialize it with an existing file through File path
                                                                                                                                                                                                            using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(dir + "sample.bmp"))
                                                                                                                                                                                                            {
                                                                                                                                                                                                                //Create an instance of PsdOptions class
                                                                                                                                                                                                                Aspose.Imaging.ImageOptions.PsdOptions psdOptions = new Aspose.Imaging.ImageOptions.PsdOptions();

                                                                                                                                                                                                                //Set the CompressionMethod as RLE
                                                                                                                                                                                                                //Note: Other supported CompressionMethod is CompressionMethod.RAW [No Compression]
                                                                                                                                                                                                                psdOptions.CompressionMethod = Aspose.Imaging.FileFormats.Psd.CompressionMethod.RLE;

                                                                                                                                                                                                                //Set the ColorMode to GrayScale
                                                                                                                                                                                                                //Note: Other supported ColorModes are ColorModes.Bitmap and ColorModes.RGB
                                                                                                                                                                                                                psdOptions.ColorMode = Aspose.Imaging.FileFormats.Psd.ColorModes.Grayscale;

                                                                                                                                                                                                                //Save the image to disk location with supplied PsdOptions settings
                                                                                                                                                                                                                image.Save(dir + "output.psd", psdOptions);
                                                                                                                                                                                                            }

این مثال نشان می دهد که چگونه یک تصویر PNG را به فرمت PSD با استفاده از گزینه های مختلف خاص PSD ذخیره کنید.

string dir = "c:\\temp\\";

                                                                                                       // Create a PNG image of 100x100 px.
                                                                                                       using (Aspose.Imaging.FileFormats.Png.PngImage pngImage = new Aspose.Imaging.FileFormats.Png.PngImage(100, 100, Aspose.Imaging.FileFormats.Png.PngColorType.TruecolorWithAlpha))
                                                                                                       {
                                                                                                           // Define a linear blue-transparent gradient.
                                                                                                           Aspose.Imaging.Brushes.LinearGradientBrush gradientBrush = new Aspose.Imaging.Brushes.LinearGradientBrush(
                                                                                                                   new Aspose.Imaging.Point(0, 0),
                                                                                                                   new Aspose.Imaging.Point(pngImage.Width, pngImage.Height),
                                                                                                                   Aspose.Imaging.Color.Blue,
                                                                                                                   Aspose.Imaging.Color.Transparent);

                                                                                                           Aspose.Imaging.Graphics graphics = new Aspose.Imaging.Graphics(pngImage);

                                                                                                           // Fill the PNG image with the linear blue-transparent gradient.
                                                                                                           graphics.FillRectangle(gradientBrush, pngImage.Bounds);

                                                                                                           // The following options will be used to save the PNG image to PSD format.
                                                                                                           Aspose.Imaging.ImageOptions.PsdOptions saveOptions = new Aspose.Imaging.ImageOptions.PsdOptions();

                                                                                                           // The number of bits per channel
                                                                                                           saveOptions.ChannelBitsCount = 8;

                                                                                                           // The number of channels. One channel for each color component R,G,B,A
                                                                                                           saveOptions.ChannelsCount = 4;

                                                                                                           // The color mode
                                                                                                           saveOptions.ColorMode = Aspose.Imaging.FileFormats.Psd.ColorModes.Rgb;

                                                                                                           // No compression
                                                                                                           saveOptions.CompressionMethod = Imaging.FileFormats.Psd.CompressionMethod.Raw;

                                                                                                           // Default version is 6
                                                                                                           saveOptions.Version = 6;            

                                                                                                           using (System.IO.FileStream stream = System.IO.File.Create(dir + "saveoptions.psd"))
                                                                                                           {
                                                                                                               pngImage.Save(stream, saveOptions);
                                                                                                               System.Console.WriteLine("The size of the PSD image with RAW compression: {0}", stream.Length);
                                                                                                           }

                                                                                                           using (System.IO.FileStream stream = System.IO.File.Create(dir + "saveoptions.RLE.psd"))
                                                                                                           {
                                                                                                               // The RLE compression allows to reduce the size of the output image
                                                                                                               saveOptions.CompressionMethod = Imaging.FileFormats.Psd.CompressionMethod.RLE;

                                                                                                               pngImage.Save(stream, saveOptions);
                                                                                                               System.Console.WriteLine("The size of the PSD image with RLE compression: {0}", stream.Length);
                                                                                                           }

                                                                                                           // The output may look like this:
                                                                                                           // The size of the PSD image with RAW compression: 40090
                                                                                                           // The size of the PSD image with RLE compression: 16185
                                                                                                       }

CompressionMethod

دریافت یا تنظیم روش فشرده سازی PSD.

public CompressionMethod CompressionMethod { get; set; }

ارزش املاک

CompressionMethod

Examples

این مثال نشان دهنده استفاده از Aspsoe.Imaging برای .Net API برای تبدیل تصاویر به فرمت PSD است. برای رسیدن به این هدف این مثال یک تصویر موجود را بارگذاری می کند و سپس آن را به فرمت PSD ذخیره می کند.

string dir = "c:\\temp\\";

                                                                                                                                                                                                            //Creates an instance of image class and initialize it with an existing file through File path
                                                                                                                                                                                                            using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(dir + "sample.bmp"))
                                                                                                                                                                                                            {
                                                                                                                                                                                                                //Create an instance of PsdOptions class
                                                                                                                                                                                                                Aspose.Imaging.ImageOptions.PsdOptions psdOptions = new Aspose.Imaging.ImageOptions.PsdOptions();

                                                                                                                                                                                                                //Set the CompressionMethod as RLE
                                                                                                                                                                                                                //Note: Other supported CompressionMethod is CompressionMethod.RAW [No Compression]
                                                                                                                                                                                                                psdOptions.CompressionMethod = Aspose.Imaging.FileFormats.Psd.CompressionMethod.RLE;

                                                                                                                                                                                                                //Set the ColorMode to GrayScale
                                                                                                                                                                                                                //Note: Other supported ColorModes are ColorModes.Bitmap and ColorModes.RGB
                                                                                                                                                                                                                psdOptions.ColorMode = Aspose.Imaging.FileFormats.Psd.ColorModes.Grayscale;

                                                                                                                                                                                                                //Save the image to disk location with supplied PsdOptions settings
                                                                                                                                                                                                                image.Save(dir + "output.psd", psdOptions);
                                                                                                                                                                                                            }

این مثال نشان می دهد که چگونه یک تصویر PNG را به فرمت PSD با استفاده از گزینه های مختلف خاص PSD ذخیره کنید.

string dir = "c:\\temp\\";

                                                                                                       // Create a PNG image of 100x100 px.
                                                                                                       using (Aspose.Imaging.FileFormats.Png.PngImage pngImage = new Aspose.Imaging.FileFormats.Png.PngImage(100, 100, Aspose.Imaging.FileFormats.Png.PngColorType.TruecolorWithAlpha))
                                                                                                       {
                                                                                                           // Define a linear blue-transparent gradient.
                                                                                                           Aspose.Imaging.Brushes.LinearGradientBrush gradientBrush = new Aspose.Imaging.Brushes.LinearGradientBrush(
                                                                                                                   new Aspose.Imaging.Point(0, 0),
                                                                                                                   new Aspose.Imaging.Point(pngImage.Width, pngImage.Height),
                                                                                                                   Aspose.Imaging.Color.Blue,
                                                                                                                   Aspose.Imaging.Color.Transparent);

                                                                                                           Aspose.Imaging.Graphics graphics = new Aspose.Imaging.Graphics(pngImage);

                                                                                                           // Fill the PNG image with the linear blue-transparent gradient.
                                                                                                           graphics.FillRectangle(gradientBrush, pngImage.Bounds);

                                                                                                           // The following options will be used to save the PNG image to PSD format.
                                                                                                           Aspose.Imaging.ImageOptions.PsdOptions saveOptions = new Aspose.Imaging.ImageOptions.PsdOptions();

                                                                                                           // The number of bits per channel
                                                                                                           saveOptions.ChannelBitsCount = 8;

                                                                                                           // The number of channels. One channel for each color component R,G,B,A
                                                                                                           saveOptions.ChannelsCount = 4;

                                                                                                           // The color mode
                                                                                                           saveOptions.ColorMode = Aspose.Imaging.FileFormats.Psd.ColorModes.Rgb;

                                                                                                           // No compression
                                                                                                           saveOptions.CompressionMethod = Imaging.FileFormats.Psd.CompressionMethod.Raw;

                                                                                                           // Default version is 6
                                                                                                           saveOptions.Version = 6;            

                                                                                                           using (System.IO.FileStream stream = System.IO.File.Create(dir + "saveoptions.psd"))
                                                                                                           {
                                                                                                               pngImage.Save(stream, saveOptions);
                                                                                                               System.Console.WriteLine("The size of the PSD image with RAW compression: {0}", stream.Length);
                                                                                                           }

                                                                                                           using (System.IO.FileStream stream = System.IO.File.Create(dir + "saveoptions.RLE.psd"))
                                                                                                           {
                                                                                                               // The RLE compression allows to reduce the size of the output image
                                                                                                               saveOptions.CompressionMethod = Imaging.FileFormats.Psd.CompressionMethod.RLE;

                                                                                                               pngImage.Save(stream, saveOptions);
                                                                                                               System.Console.WriteLine("The size of the PSD image with RLE compression: {0}", stream.Length);
                                                                                                           }

                                                                                                           // The output may look like this:
                                                                                                           // The size of the PSD image with RAW compression: 40090
                                                                                                           // The size of the PSD image with RLE compression: 16185
                                                                                                       }

PsdVersion

دریافت یا تنظیم فرمت فایل می تواند PSD یا PSB باشد.

public PsdVersion PsdVersion { get; set; }

ارزش املاک

PsdVersion

RefreshImagePreviewData

دریافت یا تنظیم یک مقدار نشان می دهد که آیا [تجدید داده های پیش نمایش تصویر] - گزینه مورد استفاده برای به حداکثر رساندن سازگاری با سایر مخاطبین تصویر PSD.لطفا توجه داشته باشید که لایه های متن به طرح نهایی برای پلت فرم Compact Framework پشتیبانی نمی شود.

public bool RefreshImagePreviewData { get; set; }

ارزش املاک

bool

RemoveGlobalTextEngineResource

دریافت یا تنظیم یک مقدار نشان می دهد که آیا - حذف منبع موتور متن جهانی - برای برخی از فایل های PSD با لایه های متنی استفاده می شود، تنها در مورد زمانی که آنها نمی توانند در Adobe Photoshop پس از پردازش باز شوند (به طور عمده برای فونت های غایب لایه های متنی مرتبط).پس از استفاده از این گزینه، کاربر نیاز به انجام بعدی در فایل باز در فتوشاپ: منوی “نص” -&gt؛ “فرآیند از دست رفته فونت ها”.لطفا توجه داشته باشید که این عملیات ممکن است برخی از تغییرات طرح نهایی را ایجاد کند.

public bool RemoveGlobalTextEngineResource { get; set; }

ارزش املاک

bool

VectorizationOptions

به دست آوردن و یا تنظیم گزینه های وکتوری PSD.

public PsdVectorizationOptions VectorizationOptions { get; set; }

ارزش املاک

PsdVectorizationOptions

Version

دریافت یا تنظیم نسخه فایل PSD.

public int Version { get; set; }

ارزش املاک

int

Examples

این مثال نشان می دهد که چگونه یک تصویر PNG را به فرمت PSD با استفاده از گزینه های مختلف خاص PSD ذخیره کنید.

string dir = "c:\\temp\\";

                                                                                                       // Create a PNG image of 100x100 px.
                                                                                                       using (Aspose.Imaging.FileFormats.Png.PngImage pngImage = new Aspose.Imaging.FileFormats.Png.PngImage(100, 100, Aspose.Imaging.FileFormats.Png.PngColorType.TruecolorWithAlpha))
                                                                                                       {
                                                                                                           // Define a linear blue-transparent gradient.
                                                                                                           Aspose.Imaging.Brushes.LinearGradientBrush gradientBrush = new Aspose.Imaging.Brushes.LinearGradientBrush(
                                                                                                                   new Aspose.Imaging.Point(0, 0),
                                                                                                                   new Aspose.Imaging.Point(pngImage.Width, pngImage.Height),
                                                                                                                   Aspose.Imaging.Color.Blue,
                                                                                                                   Aspose.Imaging.Color.Transparent);

                                                                                                           Aspose.Imaging.Graphics graphics = new Aspose.Imaging.Graphics(pngImage);

                                                                                                           // Fill the PNG image with the linear blue-transparent gradient.
                                                                                                           graphics.FillRectangle(gradientBrush, pngImage.Bounds);

                                                                                                           // The following options will be used to save the PNG image to PSD format.
                                                                                                           Aspose.Imaging.ImageOptions.PsdOptions saveOptions = new Aspose.Imaging.ImageOptions.PsdOptions();

                                                                                                           // The number of bits per channel
                                                                                                           saveOptions.ChannelBitsCount = 8;

                                                                                                           // The number of channels. One channel for each color component R,G,B,A
                                                                                                           saveOptions.ChannelsCount = 4;

                                                                                                           // The color mode
                                                                                                           saveOptions.ColorMode = Aspose.Imaging.FileFormats.Psd.ColorModes.Rgb;

                                                                                                           // No compression
                                                                                                           saveOptions.CompressionMethod = Imaging.FileFormats.Psd.CompressionMethod.Raw;

                                                                                                           // Default version is 6
                                                                                                           saveOptions.Version = 6;            

                                                                                                           using (System.IO.FileStream stream = System.IO.File.Create(dir + "saveoptions.psd"))
                                                                                                           {
                                                                                                               pngImage.Save(stream, saveOptions);
                                                                                                               System.Console.WriteLine("The size of the PSD image with RAW compression: {0}", stream.Length);
                                                                                                           }

                                                                                                           using (System.IO.FileStream stream = System.IO.File.Create(dir + "saveoptions.RLE.psd"))
                                                                                                           {
                                                                                                               // The RLE compression allows to reduce the size of the output image
                                                                                                               saveOptions.CompressionMethod = Imaging.FileFormats.Psd.CompressionMethod.RLE;

                                                                                                               pngImage.Save(stream, saveOptions);
                                                                                                               System.Console.WriteLine("The size of the PSD image with RLE compression: {0}", stream.Length);
                                                                                                           }

                                                                                                           // The output may look like this:
                                                                                                           // The size of the PSD image with RAW compression: 40090
                                                                                                           // The size of the PSD image with RLE compression: 16185
                                                                                                       }

XmpData

دریافت یا تنظیم کانتینر داده XMP

public override XmpPacketWrapper XmpData { get; set; }

ارزش املاک

XmpPacketWrapper

 فارسی