Packages

 

com.aspose.imaging.fileformats.opendocument

Class OdgImage

  • All Implemented Interfaces:
    IMultipageImage, IObjectWithSizeF, IObjectWithBounds, com.aspose.internal.fileformats.opendocument.IOdImage, com.aspose.internal.progressmanagement.IProgressEventHandler, com.aspose.internal.progressmanagement.IProgressInformer, com.aspose.ms.System.IDisposable, Closeable, AutoCloseable


    public class OdgImage
    extends OdImage

    The Open Document Graphic

    <inheritdoc></inheritdoc>
    Code example:

    This example loads a multi-page ODG image.


    String dir = "c:\\temp\\";
    
    // Using Aspose.Imaging.Image.Load is a unified way to load image.
    com.aspose.imaging.fileformats.opendocument.MultiPageImage image = (com.aspose.imaging.fileformats.opendocument.MultiPageImage) com.aspose.imaging.Image.load(dir + "sample.odg");
    try {
        // Cast to OdgImage
        com.aspose.imaging.fileformats.opendocument.OdgImage odgImage = (com.aspose.imaging.fileformats.opendocument.OdgImage) image;
    
        // Get all pages
        com.aspose.imaging.Image[] pages = odgImage.getPages();
    
        // Do some image processing
    } finally {
        image.dispose();
    }
    

    • Constructor Detail

      • OdgImage

        public OdgImage(StreamContainer streamContainer)

        Initializes a new instance of the OdgImage class.

        Parameters:
        streamContainer - The stream.
    • Method Detail

      • getFileFormat

        public long getFileFormat()

        Gets a value of file format

        Overrides:
        getFileFormat in class Image
        Returns:
        a value of file format
      • resize

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

        Resizes the image.

        Overrides:
        resize in class OdImage
        Parameters:
        newWidth - The new width.
        newHeight - The new height.
        settings - The resize settings.
      • resize

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

        Resizes the image.

        Overrides:
        resize in class OdImage
        Parameters:
        newWidth - The new width.
        newHeight - The new height.
        resizeType - The resize type.
      • rotateFlip

        public void rotateFlip(int rotateFlipType)

        Rotates, flips, or rotates and flips the image.

        Overrides:
        rotateFlip in class OdImage
        Parameters:
        rotateFlipType - Type of the rotate flip.