Resizing images to fit the parent node

前端 未结 6 1713
佛祖请我去吃肉
佛祖请我去吃肉 2020-11-28 14:10

How do I get an image in an ImageView to automatically resize such that it always fits the parent node?

Here is a small code example:

@Override
publi         


        
6条回答
  •  一整个雨季
    2020-11-28 14:38

    Use ScrollPane or simply Pane to overcome this problem: Example:

     img_view1.fitWidthProperty().bind(scrollpane_imageview1.widthProperty()); 
     img_view1.fitHeightProperty().bind(scrollpane_imageview1.heightProperty());
    

提交回复
热议问题