Java Reference
In-Depth Information
Ta b l e 6 . 4
SRC BlendModes
BlendMode
Description
SRC_ATOP
The part of the top input that is lying inside the bottom input is blended
with the bottom input
SRC_IN
The part of the top input that is lying inside the bottom input is kept inside
the resulting image
SRC_OUT
The part of the top input that is lying outside the bottom input is kept
inside the resulting image
SRC_OVER
The top input is blended over the bottom input
Listing 6.5
Demonstrating SRC_OUT BlendMode
import javafx.scene.shape.*;
import javafx.scene.paint.*;
import javafx.stage.*;
import javafx.scene.*;
import javafx.scene.effect.*;
import javafx.scene.text.*;
Stage {
scene: Scene {
width: 160 height: 80
content: [
Text {
effect: Blend {
mode: BlendMode.SRC_OUT
topInput: Flood {
paint: LinearGradient {
proportional: true
startX: 0.0, startY: 0.0
endX: 1.0, endY: 0.0
stops: [
Stop {
offset: 0.0
color: Color.WHITE
},
Stop {
offset: 1.0
color: Color.BLACK
}
]
}
continues
 
Search WWH ::




Custom Search