PsdLoadOptions

PsdLoadOptions class

Psd load options

public class PsdLoadOptions : LoadOptions

Constructors

Name Description
PsdLoadOptions() The default constructor.

Properties

Name Description
BufferSizeHint { get; set; } Gets or sets the buffer size hint which is defined max allowed size for all internal buffers.
DataBackgroundColor { get; set; } Gets or sets the Image background Color.
DataRecoveryMode { get; set; } Gets or sets the data recovery mode.
IgnoreAlphaChannel { get; set; } Gets or sets a value indicating whether [ignore alpha channel].
IgnoreTextLayerWidthOnUpdate { get; set; } Gets or sets a value indicating whether PSD text layer fixed width will be ignored on UpdateText operation execution.
LoadEffectsResource { get; set; } Gets or sets a value indicating whether [load effects resource] (by default resource is not loaded). When set this option only supported effects will be rendered to final merged image.
ProgressEventHandler { get; set; } Gets or sets the progress event handler.
ReadOnlyMode { get; set; } Gets or sets a value indicating whether [use read only mode]. This is read-only mode, supported for identical compatibility with Adobe Photoshop. When this option is set, all changes applied for layers will not be saved to final image. All data is used from ImageData section, so it is identical to Photoshop. By default all loaded images are not identical to Adobe Photoshop compatible.
UseDiskForLoadEffectsResource { get; set; } Gets or sets a value indicating whether [use disk for load effects resource] (by default used disk to load effects resource, but can be used memory if it is enought by setting this value to false).
UseIccProfileConversion { get; set; } Gets or sets a value indicating whether ICC profile conversion should be applied.

Examples

The following example demonstrates that the document conversion progress works correctly and without an exception.

[C#]

string sourceFilePath = "Apple.psd";
Stream outputStream = new MemoryStream();

Aspose.PSD.ProgressEventHandler localProgressEventHandler = delegate(ProgressEventHandlerInfo progressInfo)
{
    string message = string.Format(
        "{0} {1}: {2} out of {3}",
        progressInfo.Description,
        progressInfo.EventType,
        progressInfo.Value,
        progressInfo.MaxValue);
    Console.WriteLine(message);
};

Console.WriteLine("---------- Loading Apple.psd ----------");
var loadOptions = new PsdLoadOptions() { ProgressEventHandler = localProgressEventHandler };
using (PsdImage image = (PsdImage)Image.Load(sourceFilePath, loadOptions))
{
    Console.WriteLine("---------- Saving Apple.psd to PNG format ----------");
    image.Save(
        outputStream,
        new PngOptions()
            {
                ColorType = PngColorType.Truecolor,
                ProgressEventHandler = localProgressEventHandler
            });

    Console.WriteLine("---------- Saving Apple.psd to PSD format ----------");
    image.Save(
        outputStream,
        new PsdOptions()
            {
                ColorMode = ColorModes.Rgb,
                ChannelsCount = 4,
                ProgressEventHandler = localProgressEventHandler
            });
}

See Also