JScript LayeredImage
From RealWorld Wiki
RealWorld scripting reference
LayeredImage is an interface wrapper accessible as a property of the Document object and can be used to access layers in a layered image. The individual layers can be obtained as standalone documents and other interface wrappers (such as RasterImage) can be used with them.
The Context global object can be a used to access the layer currently selected in the editor (available since version 2009.2).
[edit] Methods and properties
- unit Layers (get) - returns number of layers.
- object GetLayer(uint index) - returns the layer at given index as document.
- void MoveLayer(uint index, int under) - moves layer at given index under the given layer (or to the top if under is set to -1).
- void DeleteLayer(uint index) - deletes layer at given index.
- void CreateLayer(int under, object configuration) - uses a configuration object created by the CreateWizard method of the Application global object. The wizard used to create the new layer is selected when creating the configuration object. (This method was updated in version 2010.1; older syntax is not supported anymore.)
- void ImportLayer(int under, string path) - loads a document from file and creates a new layer from the document.
- void CopyToLayer(int under, object document, bool convertToRaster) - creates a new layer from a copy of the given document. The convertToRaster parameter is optional and defaults to false. If set to true, the source document will be converted to a plain raster layer. This means that if document was a layered image, it will be merged to a single layer and then inserted, the source remains untouched (convertToRaster is supported since version 2010.1).
- uint sizeX (get) - width of the image.
- uint sizeY (get) - height of the image.
- uint sizeZ (get) - depth of the image.
- uint sizeW (get) - size of the 4-th dimension of the image.