Suppose an image is displayed on a Canvas. One way to erase the image is simply to
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, 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 Answer:
Java How To Program Late Objects Version
ISBN: 9780136123712
8th Edition
Authors: Paul Deitel, Deitel & Associates