Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8099386

Add image as Paint with 9-slice scaling and tiling to FX

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Won't Fix
    • Icon: P4 P4
    • None
    • None
    • javafx
    • None

      For simple skinning of controls with images we would like to be able to use a Image as a fill with 9 part scaling to fill the area of the painted shape. There are a number of different ways the shape can be filled with the image:

        * Center - simply center the image at 1:1, clipping within the shape
        * Stretch - scale the image to fit shape, there are some sub options here
             * Simple scale to match shape width and height
             * Maintain aspect ratio (Could leave unfilled areas)
             * Maintain aspect ratio + clip, (means more cropping but completely filled)
        * Tile - start image at give position in image and repeat in x, y or both directions with optional mirroring
        * Paint 9 Stretch - The is where the image is split into 9 pieces 3 across and 3 down and the corners
                                         are fixed size and the middle and sides stretch
        * Paint 9 Tile - The is where the image is split into 9 pieces 3 across and 3 down and the corners
                                         are fixed size and the middle and sides Tile

      Attached is a prototype for the Java2D Painter implementation that does some of these styles.

            flar Jim Graham
            jasper Jasper Potts (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: