- Mastering JavaFX 10
- Sergey Grinev
- 33字
- 2021-06-25 21:21:56
ImagePattern
ImagePattern paint allows us to have an image filling a shape:
// chapter2/paint/ImagePatternDemo.java
StackPane root = new StackPane();
root.getChildren().add(
new Circle(100,
new ImagePattern(
new Image( "https://upload.wikimedia.org/wikipedia/commons/3/3f/Chimpanzee_congo_painting.jpg"
)));
The output is as follows:
