BackgroundColorResource.Color
BackgroundColorResource.Color property
Mendapat atau mengatur warna latar belakang.
public Color Color { get; set; }
Contoh
Contoh berikut menunjukkan dukungan sumber daya BackgroundColorResource.
[C#]
string sourceFilePath = "input.psd";
string outputFilePath = "output.psd";
using (var image = (PsdImage)Image.Load(sourceFilePath))
{
ResourceBlock[] imageResources = image.ImageResources;
BackgroundColorResource backgroundColorResource = null;
foreach (var imageResource in imageResources)
{
if (imageResource is BackgroundColorResource)
{
backgroundColorResource = (BackgroundColorResource)imageResource;
break;
}
}
// perbarui BackgroundColorResource
backgroundColorResource.Color = Color.DarkRed;
image.Save(outputFilePath);
}
Lihat juga
- struct Color
- class BackgroundColorResource
- ruang nama Aspose.PSD.FileFormats.Psd.Resources
- perakitan Aspose.PSD