Class ImageRenderingContext


  • @API(type=NOT_EXTENDABLE,
         src=PUBLIC)
    public class ImageRenderingContext
    extends java.lang.Object
    Contains information about the context in which the image will be rendered..
    Since:
    18
    • Constructor Detail

      • ImageRenderingContext

        public ImageRenderingContext​(Font font)
        Constructor.
        Parameters:
        font - The font.
      • ImageRenderingContext

        public ImageRenderingContext​(Font font,
                                     int dotsPerInch)
        Constructor.
        Parameters:
        font - The font.
        dotsPerInch - The current monitor DPI (Dots per Inch)
      • ImageRenderingContext

        public ImageRenderingContext​(Font font,
                                     int dotsPerInch,
                                     Rectangle imageInfo)
        Constructor.
        Parameters:
        font - The font.
        dotsPerInch - The current monitor DPI (Dots per Inch)
        imageInfo - Image's layout info.
        Since:
        24.0
    • Method Detail

      • getFont

        public Font getFont()
        Get the font used in the place where the image will be displayed. Some image handlers (for example an SVG or a MathML image handler) might use this information to render and compute the image sizes...
        Returns:
        Returns the font used in the place where the image will be displayed.
      • getDotsPerInch

        public int getDotsPerInch()
        Get the current monitor DPI settings. The default is 96.
        Returns:
        Returns the current monitor.
      • getImageDimensions

        public Dimension getImageDimensions()
        Gets the final dimension of the image that will be painted. Some image handlers (for example an SVG or a MathML image handler) might use this information to scale images without losing accuracy. If the handler does not use this information, the image is automatically scaled by the application to the display dimensions.
        Returns:
        Returns The final dimensions of the image, or null.
        Since:
        24.0