VibAResource.PsdVersion
VibAResource.PsdVersion property
获取 psd 版本。
public override int PsdVersion { get; }
例子
以下代码示例演示了对 VibAResource 资源的支持。
[C#]
// 运行时支持读写振动资源的例子。
string sourceFileName = "VibranceResource.psd";
string outputFileName = "out_VibranceResource.psd";
using (PsdImage image = (PsdImage)Image.Load(sourceFileName))
{
foreach (var layer in image.Layers)
{
foreach (var resource in layer.Resources)
{
if (resource is VibAResource)
{
var vibranceResource = (VibAResource)resource;
int vibranceValue = vibranceResource.Vibrance;
int saturationValue = vibranceResource.Saturation;
vibranceResource.Vibrance = vibranceValue * 2;
vibranceResource.Saturation = saturationValue * 2;
break;
}
}
}
image.Save(outputFileName);
}