Question: Suppose an image is displayed on a Canvas. One way to erase the image is simply to set every pixel to the same color immediately,
Suppose an image is displayed on a Canvas. One way to erase the image is simply to set every pixel to the same color immediately, but the visual effect is dull. Write an app that displays an image, then erases it by using random-number generation to select individual pixels to erase. After most of the image is erased, erase all the remaining pixels at once. You might try several variants of this problem. For example, you might display lines, circles or shapes randomly to erase regions of the screen. Investigate interface PixelWriter (package javafx.scene.image), which can be used to manipulate pixels in a Canvas. Use GraphicsContext’s getPixelWriter method to obtain the PixelWriter.
Step by Step Solution
3.52 Rating (152 Votes )
There are 3 Steps involved in it
To implement this in JavaFX well need to follow the following steps sequentially 1 Display an image ... View full answer
Get step-by-step solutions from verified subject matter experts
