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

Make fitWidth of ImageView stylable as fit-width

    Details

    • Type: Enhancement
    • Status: Open
    • Priority: P4
    • Resolution: Unresolved
    • Affects Version/s: 8u60
    • Fix Version/s: tbd
    • Component/s: javafx
    • Labels:

      Description

      In JavaFx you can set the fitWidth of an image view programmatically to resize the image shown to match the resolution and size of the current user's monitor. However, you cannot express the desired fitWidth with CSS. Some people are using background images instead of imageView as a work around but this is not always convenient.

      I suggest introducing two CSS properties fit-width and fit-height allowing me to write the following CSS for a button which uses an ImageView as its graphic.

      .myButton .imageView {
         -fx-fit-width: 30;
         -fx-fit-height: 30;
      }

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              risaksen Randahl Isaksen
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: