Class PsdOptions

Class PsdOptions

Le nom : Aspose.Imaging.ImageOptions Assemblée: Aspose.Imaging.dll (25.4.0)

Créer des images Photoshop Document (PSD) avec notre API, offrant des options polyvalentesavec différentes versions de format, méthodes de compression, modes de couleur, etbits comptent par canal de couleur. traiter sans cesse les conteneurs de métadonnées XMP,Assurer un traitement d’image complet avec la puissance des fonctionnalités du format PSDcomme les couches d’image, les masques de couche et les informations de fichier pour la personnalisationLa créativité dans vos designs.

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

Inheritance

object DisposableObject ImageOptionsBase PsdOptions

Implements

IDisposable , IHasXmpData , IHasMetadata , ICloneable

I membri ereditari

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

Cet exemple montre l’utilisation d’Aspsoe.Imaging pour .Net API pour convertir les Images au format PSD. Pour atteindre cet objectif, cet exemple charge une image existante et la sauvegarde ensuite dans le format 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);
                                                                                                                                                                                                            }

L’exemple ci-dessous montre comment convertir une image de vecteur multipage au format PSD de manière générale sans référence à un type d’image particulier.

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()

Initialisez une nouvelle instance de la classe Aspose.Imaging.ImageOptions.PsdOption.

[JsonConstructor]
public PsdOptions()

PsdOptions(PsdOptions)

Initialisez une nouvelle instance de la classe Aspose.Imaging.ImageOptions.PsdOption.

public PsdOptions(PsdOptions options)

Parameters

options PsdOptions

Le opzioni .

Properties

ChannelBitsCount

Riceve o impone il conteggio dei bit per canale di colore.

public short ChannelBitsCount { get; set; }

Valore di proprietà

short

Examples

Cet exemple montre comment enregistrer une image PNG dans le format PSD en utilisant diverses options spécifiques au 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

Riceve o impone il numero dei canali di colore.

public short ChannelsCount { get; set; }

Valore di proprietà

short

Examples

Cet exemple montre comment enregistrer une image PNG dans le format PSD en utilisant diverses options spécifiques au 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

Ottieni o impostate il modo di colore PSD.

public ColorModes ColorMode { get; set; }

Valore di proprietà

ColorModes

Examples

Cet exemple montre l’utilisation d’Aspsoe.Imaging pour .Net API pour convertir les Images au format PSD. Pour atteindre cet objectif, cet exemple charge une image existante et la sauvegarde ensuite dans le format 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);
                                                                                                                                                                                                            }

Cet exemple montre comment enregistrer une image PNG dans le format PSD en utilisant diverses options spécifiques au 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

Riceve o impone il metodo di compressione psd.

public CompressionMethod CompressionMethod { get; set; }

Valore di proprietà

CompressionMethod

Examples

Cet exemple montre l’utilisation d’Aspsoe.Imaging pour .Net API pour convertir les Images au format PSD. Pour atteindre cet objectif, cet exemple charge une image existante et la sauvegarde ensuite dans le format 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);
                                                                                                                                                                                                            }

Cet exemple montre comment enregistrer une image PNG dans le format PSD en utilisant diverses options spécifiques au 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

Riceve o impone la versione del formato del file. Può essere PSD o PSB.

public PsdVersion PsdVersion { get; set; }

Valore di proprietà

PsdVersion

RefreshImagePreviewData

Obtenez ou définissez une valeur indiquant si [fresh image preview data] - option utilisée pour maximiser la compatibilité avec d’autres visualisateurs d’image PSD.Si prega di notare che le strati di testo disegnate fino al layout finale non sono supportate per la piattaforma Compact Framework.

public bool RefreshImagePreviewData { get; set; }

Valore di proprietà

bool

RemoveGlobalTextEngineResource

Riceve o impone un valore che indica se - Rimuovere la risorsa del motore di testo globale - Utilizzato per alcuni file psd a strati di testo, solo nel caso in cui non possono essere aperti in Adobe Photoshop dopo il trattamento (principalmente per le lettere assente strati di testo correlati).Dopo aver utilizzato questa opzione, l’utente ha bisogno di fare il seguente in aperto nel file Photoshop: Menu “Testo” -> “Processo assente font”.Si prega di notare che questa operazione può causare alcune modifiche di layout finale.

public bool RemoveGlobalTextEngineResource { get; set; }

Valore di proprietà

bool

VectorizationOptions

Obtenez ou définissez les options de vectorisation PSD.

public PsdVectorizationOptions VectorizationOptions { get; set; }

Valore di proprietà

PsdVectorizationOptions

Version

Riceve o impone la versione del file PSD.

public int Version { get; set; }

Valore di proprietà

int

Examples

Cet exemple montre comment enregistrer une image PNG dans le format PSD en utilisant diverses options spécifiques au 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

Ottenere o impostare il contenitore dati XMP

public override XmpPacketWrapper XmpData { get; set; }

Valore di proprietà

XmpPacketWrapper

 Français