BorderInformationResource.Unit

BorderInformationResource.Unit property

Sınır birimlerini alır veya ayarlar.

public PhysicalUnit Unit { get; set; }

Örnekler

Aşağıdaki örnek, BorderInformationResource kaynağının desteğini göstermektedir.

[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;
        }
    }

    // BorderInformationResource'u güncelle
    borderInfoResource.Width = 0.1;
    borderInfoResource.Unit = PhysicalUnit.Inches;

    image.Save(outputFilePath);
}

Ayrıca bakınız