PsdOptions Class
The psd file format create options.
Inheritance Hierarchy
SystemObject
  Aspose.ImagingDisposableObject
    Aspose.ImagingImageOptionsBase
      Aspose.Imaging.ImageOptionsPsdOptions

Namespace: Aspose.Imaging.ImageOptions
Assembly: Aspose.Imaging (in Aspose.Imaging.dll) Version: 21.04
Syntax
public class PsdOptions : ImageOptionsBase

The PsdOptions type exposes the following members.

Constructors
  NameDescription
Public methodPsdOptions
Initializes a new instance of the PsdOptions class.
Public methodPsdOptions(PsdOptions)
Initializes a new instance of the PsdOptions class.
Properties
  NameDescription
Public propertyCode exampleBufferSizeHint
Gets or sets the buffer size hint which is defined max allowed size for all internal buffers.
(Inherited from ImageOptionsBase.)
Public propertyCode exampleChannelBitsCount
Gets or sets the bits count per color channel.
Public propertyCode exampleChannelsCount
Gets or sets the color channels count.
Public propertyCode exampleColorMode
Gets or sets the psd color mode.
Public propertyCode exampleCompressionMethod
Gets or sets the psd compression method.
Public propertyDisposed
Gets a value indicating whether this instance is disposed.
(Inherited from DisposableObject.)
Public propertyFullFrame
Gets or sets a value indicating whether [full frame].
(Inherited from ImageOptionsBase.)
Public propertyMultiPageOptions
The multipage options
(Inherited from ImageOptionsBase.)
Public propertyCode examplePalette
Gets or sets the color palette.
(Inherited from ImageOptionsBase.)
Public propertyCode exampleProgressEventHandler
Gets or sets the progress event handler.
(Inherited from ImageOptionsBase.)
Public propertyPsdVersion
Gets or sets the file format version. It can be PSD or PSB.
Public propertyRefreshImagePreviewData
Gets or sets a value indicating whether [refresh image preview data] - option used to maximize compatibility with another PSD image viewers. Please note, text layers drawing to final layout is not supported for Compact Framework platform
Public propertyRemoveGlobalTextEngineResource
Gets or sets a value indicating whether - Remove the global text engine resource - Used for some text-layered psd files, in only case, when they can not be opened in Adobe Photoshop after processing (mostly for absent fonts text layers related). After using this option, user need to Make next in opened in Photoshop file: Menu "Text" -> "Process absent fonts". After that operation all text will appear again. Please note, that this operation may cause some final layout changes.
Public propertyCode exampleResolutionSettings
Gets or sets the resolution settings.
(Inherited from ImageOptionsBase.)
Public propertySource
Gets or sets the source to create image in.
(Inherited from ImageOptionsBase.)
Public propertyVectorRasterizationOptions
Gets or sets the vector rasterization options.
(Inherited from ImageOptionsBase.)
Public propertyCode exampleVersion
Gets or sets the psd file version.
Public propertyXmpData
Get or set XMP data container
(Overrides ImageOptionsBaseXmpData.)
Methods
  NameDescription
Public methodClone
Clones this instance.
(Inherited from ImageOptionsBase.)
Public methodCode exampleDispose
Disposes the current instance.
(Inherited from DisposableObject.)
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Protected methodFinalize (Inherited from DisposableObject.)
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetType
Gets the type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Protected methodReleaseManagedResources
Releases the managed resources. Make sure no unmanaged resources are released here, since they may have been already released.
(Inherited from ImageOptionsBase.)
Protected methodReleaseUnmanagedResources
Releases the unmanaged resources. Make sure no managed resources are released here, since they may have been already released.
(Inherited from DisposableObject.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Protected methodVerifyNotDisposed
Verifies that the current instance is not disposed.
(Inherited from DisposableObject.)
Fields
  NameDescription
Protected fieldxmpData
XMP metadata of image.
(Inherited from ImageOptionsBase.)
Examples
This example demonstrates the use of Aspsoe.Imaging for .Net API to convert Images to PSD format. To achieve this goal this example loads an existing image and then saves it back to PSD format.
[C#]

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);
}
Examples
The following example shows how to convert a multipage vector image to PSD format in general way without referencing to a particular image type.
[C#]

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);
}
See Also