This section shows you image effects.
To show Image effects, we have defined three matrix: RED_MATRIX, GREEN_MATRIX, BLUE_MATRIX which shows colors:
| static final float RED_MATRIX[][] = { { 2.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f } }; static final float GREEN_MATRIX[][] = { { 0.0f, 0.0f, 0.0f }, { 0.0f, 2.0f, 0.0f }, { 0.0f, 0.0f, 0.0f } }; static final float BLUE_MATRIX[][] = { { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 2.0f } }; |
We have used four radio buttons to perform different functions by calling ActionListener class. The getDefaultToolkit() method of Toolkit class provides the default toolkit. The method getImage() of class ToolKit returns an image.
The MediaTracker class provides a media objects including images. Create an instance of MediaTracker and call addImage() method which adds the specified image. The method waitForAll() of this class loads the image which is added.
The Raster class provides an array of pixels which store the values and locate the value in Databuffer. The BandCombineOp class provides a linear combination of the bands in a Raster with specified matrix.
Here is the code of ImageEffectExample.java
import java.awt.*;
|
Output will be displayed as:

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.
Ask Questions? Discuss: Show Image Effect
Post your Comment