Packages

 

com.aspose.imaging.fileformats.svg

Class SvgImage

    • Constructor Detail

      • SvgImage

        public SvgImage(String path)

        Initializes a new instance of the SvgImage class.

        Parameters:
        path - The path to load image from and initialize pixel and palette data with.
        Throws:
        com.aspose.ms.System.ArgumentNullException - path is null.
      • SvgImage

        public SvgImage(InputStream stream)

        Initializes a new instance of the SvgImage class.

        Parameters:
        stream - The stream to load image from and initialize pixel and palette data with.
        Throws:
        com.aspose.ms.System.ArgumentNullException - stream is null.
      • SvgImage

        public SvgImage(int width,
                        int height)

        Initializes a new instance of the SvgImage class.

        Parameters:
        width - The image width.
        height - The image height.
      • SvgImage

        public SvgImage(SvgOptions svgOptions,
                        int width,
                        int height)

        Initializes a new instance of the SvgImage class.

        Parameters:
        svgOptions - The SVG options.
        width - Image width.
        height - Image height.
    • Method Detail

      • isCached

        public boolean isCached()

        Gets a value indicating whether object's data is cached currently and no data reading is required.

        Specified by:
        isCached in class DataStreamSupporter
        Returns:
        true if object's data is cached; otherwise, false.
      • getBitsPerPixel

        public int getBitsPerPixel()

        Gets the image bits per pixel count this parameter is not applicable to vector images

        Specified by:
        getBitsPerPixel in class Image
        Returns:
        The image bits per pixel count.
        Throws:
        com.aspose.ms.System.NotImplementedException - Not valid for vector images
      • getFileFormat

        public long getFileFormat()

        Gets a value of file format

        Overrides:
        getFileFormat in class Image
        Returns:
        file format
      • cacheData

        public void cacheData()

        Caches the data and ensures no additional data loading will be performed from the underlying DataStreamSupporter.DataStreamContainer.

        Specified by:
        cacheData in class DataStreamSupporter
      • resize

        public void resize(int newWidth,
                           int newHeight,
                           int resizeType)

        Resizes the image.

        Specified by:
        resize in class Image
        Parameters:
        newWidth - The new width.
        newHeight - The new height.
        resizeType - The resize type.
        Throws:
        com.aspose.ms.System.NotImplementedException - this feature is not implemented
      • resize

        public void resize(int newWidth,
                           int newHeight,
                           ImageResizeSettings settings)

        Resizes the image.

        Specified by:
        resize in class Image
        Parameters:
        newWidth - The new width.
        newHeight - The new height.
        settings - The resize settings.
        Throws:
        com.aspose.ms.System.NotImplementedException - this feature is not implemented
      • rotateFlip

        public void rotateFlip(int rotateFlipType)

        Rotates, flips, or rotates and flips the image.

        Specified by:
        rotateFlip in class Image
        Parameters:
        rotateFlipType - Type of the rotate flip.
        Throws:
        com.aspose.ms.System.NotImplementedException - this feature is not implemented
      • setPalette

        public void setPalette(IColorPalette palette,
                               boolean updateColors)

        Sets the image palette.

        Specified by:
        setPalette in class Image
        Parameters:
        palette - The palette to set.
        updateColors - if set to true colors will be updated according to the new palette; otherwise color indexes remain unchanged. Note that unchanged indexes may crash the image on loading if some indexes have no corresponding palette entries.
        Throws:
        com.aspose.ms.System.NotImplementedException - if not implemented