com.groupdocs.editor.htmlcss.resources.images.raster

Class RasterImageResourceBase

  • java.lang.Object
    • com.groupdocs.editor.htmlcss.resources.images.raster.RasterImageResourceBase
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      com.groupdocs.editor.events.ProcessEvents<com.groupdocs.editor.events.ProcessEventHandler> Disposed
      Event, which occurs when this raster image is disposed
    • Method Summary

      Methods 
      Modifier and Type Method and Description
      void dispose()
      Disposes this raster image, disposing its content and making most methods and properties non-working
      boolean equals(IHtmlResource other)
      Checks this instance with specified on reference equality.
      boolean equals(Object obj)
      Determines whether the specified Object is equal to the current Object.
      BufferedImage generateBitmap()
      Generates and returns a new instance of the 'System.Drawing.Bitmap' from this raster image.
      Ratio getAspectRatio()
      Returns an aspect ratio of this image as the width-to-height relation
      InputStream getByteContent()
      Returns content of this raster image as byte stream
      String getFilenameWithExtension()
      Returns correct filename of this raster image, which consists of name and extension.
      int getLength()
      Returns the length of this raster image file in bytes
      Dimensions getLinearDimensions()
      Returns linear dimensions of this raster image (width and height)
      String getName()
      Returns name of this raster image.
      String getTextContent()
      Returns content of this raster image as base64-encoded string
      abstract ImageType getType()
      In implementing type should return information about type of the raster image
      int hashCode()
      Serves as a hash function for a particular type.
      boolean isDisposed()
      Determines whether this raster image is disposed or not
      RasterImageResourceBase reduceToNewHeight(int targetHeightInPixels)
      Creates and returns a new reduced image resource of the same type, but with specified new reduced height and proportionally reduced width.
      void save(String fullPathToFile)
      Saves this raster image to the specified file
    • Field Detail

      • Disposed

        public final com.groupdocs.editor.events.ProcessEvents<com.groupdocs.editor.events.ProcessEventHandler> Disposed

        Event, which occurs when this raster image is disposed

    • Constructor Detail

      • RasterImageResourceBase

        public RasterImageResourceBase()
    • Method Detail

      • dispose

        public void dispose()

        Disposes this raster image, disposing its content and making most methods and properties non-working

        Specified by:
        dispose in interface com.aspose.ms.System.IDisposable
      • equals

        public boolean equals(IHtmlResource other)

        Checks this instance with specified on reference equality.

        Parameters:
        other - IHtmlResource
        Returns:
      • equals

        public boolean equals(Object obj)

        Determines whether the specified Object is equal to the current Object.

        Overrides:
        equals in class Object
      • generateBitmap

        public BufferedImage generateBitmap()

        Generates and returns a new instance of the 'System.Drawing.Bitmap' from this raster image.

        Returns:


        'System.Drawing.Bitmap' is not cached and thus will be generated every time this method will be called

      • getAspectRatio

        public Ratio getAspectRatio()

        Returns an aspect ratio of this image as the width-to-height relation

        Specified by:
        getAspectRatio in interface IImageResource
      • getFilenameWithExtension

        public String getFilenameWithExtension()

        Returns correct filename of this raster image, which consists of name and extension. Theoretically can differ from the name.

        Specified by:
        getFilenameWithExtension in interface IHtmlResource
      • getLength

        public int getLength()

        Returns the length of this raster image file in bytes

      • getName

        public String getName()

        Returns name of this raster image. Usually doesn't contain filename extension and theoretically can differ from filename.

        Specified by:
        getName in interface IHtmlResource
      • getTextContent

        public String getTextContent()

        Returns content of this raster image as base64-encoded string

        Specified by:
        getTextContent in interface IHtmlResource
      • hashCode

        public int hashCode()

        Serves as a hash function for a particular type.

        Overrides:
        hashCode in class Object
      • isDisposed

        public boolean isDisposed()

        Determines whether this raster image is disposed or not

        Specified by:
        isDisposed in interface IAuxDisposable
      • reduceToNewHeight

        public RasterImageResourceBase reduceToNewHeight(int targetHeightInPixels)
                                                  throws Exception

        Creates and returns a new reduced image resource of the same type, but with specified new reduced height and proportionally reduced width.

        Parameters:
        targetHeightInPixels - Height of the desired image in pixels. Should be strictly lesser than original height.
        Returns:
        Throws:
        Exception
      • save

        public void save(String fullPathToFile)

        Saves this raster image to the specified file

        Specified by:
        save in interface IHtmlResource
        Parameters:
        fullPathToFile - Full path to the file, which will be created or rewrited