Class BorderInformationResource

BorderInformationResource class

The resource with border information of image print settings.

public sealed class BorderInformationResource : ResourceBlock

Constructors

NameDescription
BorderInformationResource()The default constructor.

Properties

NameDescription
override DataSize { get; }Gets the resource data size in bytes.
ID { get; set; }Gets or sets the unique identifier for the resource.
override MinimalVersion { get; }Gets the minimal required PSD version.
Name { get; set; }Gets or sets the resource name. Pascal string, padded to make the size even (a null name consists of two bytes of 0).
Signature { get; }Gets the resource signature. Should be always ‘8BIM’.
Size { get; }Gets the resource block size in bytes including its data.
Unit { get; set; }Gets or sets the border units.
Width { get; set; }Gets or sets the border width.

Methods

NameDescription
Save(StreamContainer)Saves the resource block to the specified stream.
virtual ValidateValues()Validates the resource values.

Examples

The following example demonstrates the support of BorderInformationResource resource.

[C#]

string sourceFilePath = "input.psd";
string outputFilePath = "output.psd";

using (var image = (PsdImage)Image.Load(sourceFilePath))
{
    ResourceBlock[] imageResources = image.ImageResources;
    BorderInformationResource borderInfoResource = null;
    foreach (var imageResource in imageResources)
    {
        if (imageResource is BorderInformationResource)
        {
            borderInfoResource = (BorderInformationResource)imageResource;
            break;
        }
    }

    // update BorderInformationResource
    borderInfoResource.Width = 0.1;
    borderInfoResource.Unit = PhysicalUnit.Inches;

    image.Save(outputFilePath);
}

See Also