public class VsmsResource extends VectorPathDataResource
Class VsmsResource. This resource contains information about vector layer mask
VectorPathDataResource
,
LayerResource
An example of changing path operations when working with shapes. The program reads a predefined vector path records (LengthRecord) and changes their path operations then saves a modified copy of the document as a new PSD file.
String inPsdFilePath = "PathOperationsShape.psd"; String outPsdFilePath = "out_" + inPsdFilePath; // Load a PSD file containing a predefined vsms resource PsdImage psdImage = (PsdImage)Image.load(inPsdFilePath); try { // Find first VsmsResource in resources of the predefined layer VsmsResource resource = null; for (LayerResource layerResource : psdImage.getLayers()[1].getResources()) { if (layerResource instanceof VsmsResource) { resource = (VsmsResource)layerResource; break; } } LengthRecord lengthRecord0 = (LengthRecord)resource.getPaths()[2]; LengthRecord lengthRecord1 = (LengthRecord)resource.getPaths()[7]; LengthRecord lengthRecord2 = (LengthRecord)resource.getPaths()[11]; // Change the way in which shapes are combined lengthRecord0.setPathOperations(PathOperations.ExcludeOverlappingShapes); lengthRecord1.setPathOperations(PathOperations.IntersectShapeAreas); lengthRecord2.setPathOperations(PathOperations.SubtractFrontShape); // Save a modified copy of loaded PSD file on the path psdImage.save(outPsdFilePath); } finally { psdImage.dispose(); }
Modifier and Type | Field and Description |
---|---|
static int |
TypeToolKey
The type tool info key.
|
PsbResourceSignature, ResourceSignature
Constructor and Description |
---|
VsmsResource()
Initializes a new instance of the
VsmsResource class. |
VsmsResource(byte[] data)
Initializes a new instance of the
VsmsResource class. |
Modifier and Type | Method and Description |
---|---|
int |
getKey()
Gets the layer resource key.
|
getLength, getPaths, getPsdVersion, getSignature, getVersion, isDisabled, isInverted, isNotLinked, save, setDisabled, setInverted, setNotLinked, setPaths, setVersion
toString
public static final int TypeToolKey
The type tool info key.
public VsmsResource(byte[] data)
Initializes a new instance of the VsmsResource
class.
data
- The resource data.PsdImageArgumentException
- Invalid Vsms Resource valuepublic VsmsResource()
Initializes a new instance of the VsmsResource
class.
public int getKey()
Gets the layer resource key.
getKey
in class LayerResource
Copyright (c) 2008-2020 Aspose Pty Ltd. All Rights Reserved.