Class PsdResource
An image resource Egami does not map to RasterMetadata, kept as it was read.
public sealed record PsdResource : IEquatable<PsdResource>
- Inheritance
-
PsdResource
- Implements
- Inherited Members
Examples
using Raster image = Raster.Load("photo.psd");
var details = (PsdDetails)image.Metadata.FormatDetails!;
Console.WriteLine($"{(details.Version == 2 ? "PSB" : "PSD")}, {details.ColorMode} at {details.BitsPerChannel} bits, {details.ChannelCount} channels, {details.Compression}");
if (!details.HasRealComposite)
{
// Saved without Maximize Compatibility: what loaded is Photoshop's placeholder, and a warning says so.
Console.WriteLine("Save the file again with Maximize Compatibility on.");
}
foreach (PsdResource resource in details.OtherResources)
{
Console.WriteLine($"Resource {resource.Id}, {resource.Data.Length} bytes");
}
Constructors
PsdResource(int, string, ReadOnlyMemory<byte>)
An image resource Egami does not map to RasterMetadata, kept as it was read.
public PsdResource(int Id, string Name, ReadOnlyMemory<byte> Data)
Parameters
IdintThe resource's number, such as 1036 for the thumbnail.
NamestringThe resource's name, usually empty.
DataReadOnlyMemory<byte>The resource's data.
Examples
using Raster image = Raster.Load("photo.psd");
var details = (PsdDetails)image.Metadata.FormatDetails!;
Console.WriteLine($"{(details.Version == 2 ? "PSB" : "PSD")}, {details.ColorMode} at {details.BitsPerChannel} bits, {details.ChannelCount} channels, {details.Compression}");
if (!details.HasRealComposite)
{
// Saved without Maximize Compatibility: what loaded is Photoshop's placeholder, and a warning says so.
Console.WriteLine("Save the file again with Maximize Compatibility on.");
}
foreach (PsdResource resource in details.OtherResources)
{
Console.WriteLine($"Resource {resource.Id}, {resource.Data.Length} bytes");
}
Properties
Data
The resource's data.
public ReadOnlyMemory<byte> Data { get; init; }
Property Value
Id
The resource's number, such as 1036 for the thumbnail.
public int Id { get; init; }
Property Value
Name
The resource's name, usually empty.
public string Name { get; init; }