Forum Stats

  • 3,836,844 Users
  • 2,262,198 Discussions
  • 7,900,128 Comments

Discussions

Force ImageView to resize an Image?

990159
990159 Member Posts: 22
edited Feb 18, 2013 10:17AM in JavaFX 2.0 and Later
Is there any way to force an ImageView to resize an Image (ImageView.fitHeight(50) has no effect) while the ImageView is not attached to a scene?

Thanks for any hint!
Tagged:

Answers

  • 990159
    990159 Member Posts: 22
    edited Feb 18, 2013 10:17AM
    Solution here: 10859430
    Short story: use
    SnapshotParameters params = new SnapshotParameters();
    params.setFill(Color.TRANSPARENT); 
    return imageView.snapshot(params, null);
    to get the resized image.

    Edited by: srynoname on 18.02.2013 07:16
This discussion has been closed.