Packages

 

com.aspose.psd.fileformats.psd.layers.layerresources

Class NvrtResource



  • public class NvrtResource
    extends AdjustmentLayerResource

    Class NvrtResource. Resource of Invert Adjustment Layer.

    See Also:
    AdjustmentLayerResource, LayerResource
    Code example:

    An example of finding NvrtResource of an invert adjustment layer.


    String inPsdFilePath = "InvertAdjustmentLayer.psd";
                
    NvrtResource nvrtResource = null;
                
    // Load a predefined PSD containing an invert adjustment layer
    PsdImage psdImage = (PsdImage)Image.load(inPsdFilePath);
    try
    {
        // Try to find a resource of the invert adjustment layer
        for (Layer layer : psdImage.getLayers())
        {
            if (layer instanceof InvertAdjustmentLayer)
            {
                for (LayerResource layerResource : layer.getResources())
                {
                    if (layerResource instanceof NvrtResource)
                    {
                        // The NvrtResource is found
                        nvrtResource = (NvrtResource)layerResource;
                        break;
                    }
                }
            }
        }
    }
    finally
    {
        psdImage.dispose();
    }
    

    • Field Detail

      • TypeToolKey

        public static final int TypeToolKey

        The type tool info key.

        See Also:
        Constant Field Values
    • Constructor Detail

      • NvrtResource

        public NvrtResource()

        Initializes a new instance of the NvrtResource class.

      • NvrtResource

        public NvrtResource(byte[] data)

        Initializes a new instance of the NvrtResource class.

        Parameters:
        data - The data of the resource.
        Throws:
        PsdImageArgumentException - Invalid NvrtResource data.
    • Method Detail

      • getKey

        public int getKey()

        Gets the layer resource key.

        Specified by:
        getKey in class LayerResource
      • getLength

        public int getLength()

        Gets the layer resource length in bytes.

        Specified by:
        getLength in class LayerResource
      • save

        public void save(StreamContainer streamContainer,
                         int psdVersion)

        Saves the resource to the specified stream container.

        Overrides:
        save in class AdjustmentLayerResource
        Parameters:
        streamContainer - The stream container to save to.
        psdVersion - The PSD version.