Class ImagePainter


  • public class ImagePainter
    extends Object
    Provides utility methods to draw images.
    • Method Detail

      • computeOptimalSize

        public static void computeOptimalSize​(Image image,
                                              Size size)
        Computes the optimal size of an image.

        The given size is modified to set the optimal size.

        Parameters:
        image - the image.
        size - the size to modify.
      • drawImageInArea

        public static void drawImageInArea​(GraphicsContext g,
                                           Image image,
                                           int x,
                                           int y,
                                           int width,
                                           int height,
                                           int horizontalAlignment,
                                           int verticalAlignment)
        Draws an image aligned in a area.
        Parameters:
        g - the graphics context.
        image - the image.
        x - the area x coordinate.
        y - the area y coordinate.
        width - the area width.
        height - the area height.
        horizontalAlignment - the horizontal alignment.
        verticalAlignment - the vertical alignment.