Class DrawPictureShape

    • Constructor Detail

      • DrawPictureShape

        public DrawPictureShape​(PictureShape<?,​?> shape)
    • Method Detail

      • drawContent

        public void drawContent​(Graphics2D graphics)
        Description copied from interface: Drawable
        draw any content within this shape (image, text, etc.).
        Specified by:
        drawContent in interface Drawable
        Overrides:
        drawContent in class DrawShape
        Parameters:
        graphics - the graphics to draw into
      • getImageRenderer

        public static ImageRenderer getImageRenderer​(Graphics2D graphics,
                                                     String contentType)
        Returns an ImageRenderer for the PictureData
        Parameters:
        graphics - the graphics context
        Returns:
        the image renderer
      • resize

        public void resize()
        Resize this picture to the default size. For PNG and JPEG resizes the image to 100%, for other types, if the size can't be determined it will be 200x200 pixels.
      • resize

        public void resize​(Rectangle2D target)
        Fit picture shape into the target rectangle, maintaining the aspect ratio and repositioning within the target rectangle with a centered alignment.
        Parameters:
        target - The target rectangle
      • resize

        public void resize​(Rectangle2D target,
                           RectAlign align)
        Fit picture shape into the target rectangle, maintaining the aspect ratio and repositioning within the target rectangle based on the specified alignment (gravity).
        Parameters:
        target - The target rectangle
        align - The alignment within the target rectangle when resizing. A null value corresponds to RectAlign.CENTER