public final class BackgroundColorResource extends ResourceBlock
The resource with border information of image print settings.
An example of reading and modifying a background color resource.
String inPsdFilePath = "input.psd";
String outPsdFilePath = "output.psd";
// Load a PSD file containing a predefined background color resource
PsdImage psdImage = (PsdImage)Image.load(inPsdFilePath);
try
{
BackgroundColorResource backgroundColorResource = null;
for (ResourceBlock imageResource : psdImage.getImageResources())
{
if (imageResource instanceof BackgroundColorResource)
{
backgroundColorResource = (BackgroundColorResource)imageResource;
break;
}
}
if (backgroundColorResource == null)
{
throw new Exception("BackgroundColorResource not found");
}
// Update color of the background color resource
backgroundColorResource.setColor(Color.getDarkRed());
// Save a modified copy of loaded PSD file on the path
psdImage.save(outPsdFilePath);
}
finally
{
psdImage.dispose();
}
ResourceBlock.ResourceBlockStateResouceBlockMeSaSignature, ResouceBlockSignature| Constructor and Description |
|---|
BackgroundColorResource()
Initializes a new instance of the
BackgroundColorResource class. |
| Modifier and Type | Method and Description |
|---|---|
Color |
getColor()
Gets or sets the background color.
|
int |
getDataSize()
Gets the resource data size in bytes.
|
int |
getMinimalVersion()
Gets the minimal required PSD version.
|
void |
setColor(Color value)
Gets or sets the background color.
|
void |
setColorSpace(int value)
Gets or sets a color space.
|
getID, getName, getSignature, getSize, save, setID, setName, validateValuespublic BackgroundColorResource()
Initializes a new instance of the BackgroundColorResource class.
public int getDataSize()
Gets the resource data size in bytes.
Value: The resource data size.getDataSize in class ResourceBlockpublic final Color getColor()
Gets or sets the background color.
public final void setColor(Color value)
Gets or sets the background color.
public int getMinimalVersion()
Gets the minimal required PSD version.
Value: The minimal PSD version.getMinimalVersion in class ResourceBlockpublic final void setColorSpace(int value)
Gets or sets a color space.
Value: The background color space.Copyright (c) 2008-2020 Aspose Pty Ltd. All Rights Reserved.