May 2018
Intermediate to advanced
268 pages
6h 43m
English
This blend mode draws only part of the top input lying inside the node it's applied to. By using this, you can get nice clipping effect:

Here, we used the same cosmonaut image as a fill for the "JavaFX" text:
// chapter8/combining/BlendSrcDemo.javapublic void start(Stage primaryStage) { Image image = new Image( "https://github.com/sgrinev/mastering-javafx-9-book/blob/master/resources/sample.jpg?raw=true", 300, 300, true, true); ImageInput ii = new ImageInput(image, 0, 0); Blend blend = new Blend(); blend.setMode(BlendMode.SRC_ATOP); blend.setTopInput(ii); Text text = new Text(0, 80, "JavaFX"); text.setFont(Font.font("Verdana", ...Read now
Unlock full access