-
Bug
-
Resolution: Won't Fix
-
P4
-
None
-
7u45
-
Windows 7
Mac OS X 10.7.5 Lion
Cannot dynamically resize stage(change width automatically when height is changed and vice versa) with an imageview inside a scene.
// Stage Code.
stage.setResizable(true);
Scene scene = new Scene(page);
stage.setScene(scene);
stage.initStyle(StageStyle.UTILITY);
stage.sizeToScene();
double aspectRatio=selectedImage.getWidth()/selectedImage.getHeight();
stage.minWidthProperty().bind(scene.heightProperty().multiply(aspectRatio));
stage.minHeightProperty().bind(scene.widthProperty().divide(aspectRatio));
// ImageView code.
Rectangle2D primaryScreenBounds = Screen.getPrimary().getVisualBounds();
double[] returnHgtWdt = ISMUtil.maintainAspectRatioOfImage(image.getWidth(), image.getHeight(), primaryScreenBounds.getWidth(), primaryScreenBounds.getHeight()-50);
setHeightWidthValue(returnHgtWdt[0], returnHgtWdt[1]);
imageView.setPreserveRatio(true);
imageView.setImage(image);
imageView.fitHeightProperty().bind(stage.heightProperty());
imageView.fitWidthProperty().bind(stage.widthProperty());
- is blocked by
-
JDK-8091789 make ImageView resizable
- Open