public final class BorderInformationResource extends ResourceBlock
The resource with border information of image print settings.
An example of reading, modifying and saving a PSD file that contains a border information resource.
String inPsdFilePath = "input.psd"; String outPsdFilePath = "output.psd"; // Load a PSD file containing a predefined image resource PsdImage psdImage = (PsdImage)Image.load(inPsdFilePath); try { ResourceBlock[] imageResources = psdImage.getImageResources(); // Find first border information resource in image resources BorderInformationResource borderInfoResource = null; for (ResourceBlock imageResource : imageResources) { if (imageResource instanceof BorderInformationResource) { borderInfoResource = (BorderInformationResource)imageResource; break; } } // Update some properties of the border information resource borderInfoResource.setWidth(0.1); borderInfoResource.setUnit(PhysicalUnit.Inches); // Save a modified copy of loaded PSD file on the path psdImage.save(outPsdFilePath); } finally { psdImage.dispose(); }
ResourceBlock.ResourceBlockState
ResouceBlockMeSaSignature, ResouceBlockSignature
Constructor and Description |
---|
BorderInformationResource()
Initializes a new instance of the
BorderInformationResource class. |
Modifier and Type | Method and Description |
---|---|
int |
getDataSize()
Gets the resource data size in bytes.
|
int |
getMinimalVersion()
Gets the minimal required PSD version.
|
int |
getUnit()
Gets or sets the border units.
|
double |
getWidth()
Gets or sets the border width.
|
void |
setUnit(int value)
Gets or sets the border units.
|
void |
setWidth(double value)
Gets or sets the border width.
|
getID, getName, getSignature, getSize, save, setID, setName, validateValues
public BorderInformationResource()
Initializes a new instance of the BorderInformationResource
class.
public int getDataSize()
Gets the resource data size in bytes.
Value: The resource data size.getDataSize
in class ResourceBlock
public int getMinimalVersion()
Gets the minimal required PSD version.
Value: The minimal PSD version.getMinimalVersion
in class ResourceBlock
public final double getWidth()
Gets or sets the border width.
public final void setWidth(double value)
Gets or sets the border width.
public final int getUnit()
Gets or sets the border units.
public final void setUnit(int value)
Gets or sets the border units.