Class PsdFile
Inheritance
System.Object
PsdFile
Syntax
Constructors
PsdFile(PsdFileVersion)
Declaration
public PsdFile(PsdFileVersion version = PsdFileVersion.Psd)
Parameters
PsdFile(Stream, LoadContext, ELoadFlag)
Declaration
public PsdFile(Stream stream, LoadContext loadContext, ELoadFlag loadFlag = ELoadFlag.Header | ELoadFlag.ColorMode | ELoadFlag.ImageData | ELoadFlag.All)
Parameters
PsdFile(String, LoadContext, ELoadFlag)
Declaration
public PsdFile(string filename, LoadContext loadContext, ELoadFlag loadFlag = ELoadFlag.Header | ELoadFlag.ColorMode | ELoadFlag.ImageData | ELoadFlag.All)
Parameters
Fields
ColorModeData
If ColorMode is ColorModes.Indexed, the following 768 bytes will contain
a 256-color palette. If the ColorMode is ColorModes.Duotone, the data
following presumably consists of screen parameters and other related information.
Unfortunately, it is intentionally not documented by Adobe, and non-Photoshop
readers are advised to treat duotone images as gray-scale images.
Declaration
public byte[] ColorModeData
Field Value
Type |
Description |
System.Byte[] |
|
Properties
AbsoluteAlpha
Declaration
public bool AbsoluteAlpha { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
AdditionalInfo
Declaration
public List<LayerInfo> AdditionalInfo { get; }
Property Value
Type |
Description |
System.Collections.Generic.List<LayerInfo> |
|
BaseLayer
Represents the composite image.
Declaration
public Layer BaseLayer { get; set; }
Property Value
BitDepth
The number of bits per channel. Supported values are 1, 8, 16, and 32.
Declaration
public int BitDepth { get; set; }
Property Value
Type |
Description |
System.Int32 |
|
ChannelCount
The number of channels in the image, including any alpha channels.
Declaration
public short ChannelCount { get; set; }
Property Value
Type |
Description |
System.Int16 |
|
ColorMode
The color mode of the file.
Declaration
public PsdColorMode ColorMode { get; set; }
Property Value
ColumnCount
The width of the image in pixels.
Declaration
public int ColumnCount { get; set; }
Property Value
Type |
Description |
System.Int32 |
|
globalLayerMaskData
Declaration
public byte[] globalLayerMaskData { get; }
Property Value
Type |
Description |
System.Byte[] |
|
ImageCompression
Declaration
public ImageCompression ImageCompression { get; set; }
Property Value
ImageResources
The Image resource blocks for the file
Declaration
public ImageResources ImageResources { get; set; }
Property Value
IsLargeDocument
Declaration
public bool IsLargeDocument { get; }
Property Value
Type |
Description |
System.Boolean |
|
Layers
Declaration
public List<Layer> Layers { get; }
Property Value
Type |
Description |
System.Collections.Generic.List<Layer> |
|
Resolution
Declaration
public ResolutionInfo Resolution { get; set; }
Property Value
RowCount
The height of the image in pixels.
Declaration
public int RowCount { get; set; }
Property Value
Type |
Description |
System.Int32 |
|
Version
Photoshop file format version.
Declaration
public PsdFileVersion Version { get; }
Property Value
Methods
PrepareSave()
Check the validity of the PSD file and generate necessary data.
Declaration
public void PrepareSave()
Save(Stream, Encoding)
Declaration
public void Save(Stream stream, Encoding encoding)
Parameters
Type |
Name |
Description |
System.IO.Stream |
stream |
|
System.Text.Encoding |
encoding |
|
Save(String, Encoding)
Declaration
public void Save(string fileName, Encoding encoding)
Parameters
Type |
Name |
Description |
System.String |
fileName |
|
System.Text.Encoding |
encoding |
|
SetVersionInfo()
Set the VersionInfo resource on the file.
Declaration
public void SetVersionInfo()
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.