BorderInformationResource.DataSize

BorderInformationResource.DataSize property

获取以字节为单位的资源数据大小。

public override int DataSize { get; }

适当的价值

资源数据大小。

例子

以下示例演示了 BorderInformationResource 资源的支持。

[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
    borderInfoResource.Width = 0.1;
    borderInfoResource.Unit = PhysicalUnit.Inches;

    image.Save(outputFilePath);
}

也可以看看