To crop an image, an image is defined inside the class folder. The class ImageIcon calls its method getImage() which returns the specified image.
Crop Image
This section shows you how the image get crops.
To crop an image, an image is defined inside the class folder. The class ImageIcon calls its method getImage() which returns the specified image. The Insets class shows the border of a container which specifies the space leave at each of its edges.
To produce image data for a filtration of the original image, we take an existing image and a filter object by using the class FilteredImageSource. To crop an image, we have used the CropImageFilter class which is extended by the ImageFilter class.
Here is the code of CropImage.java
import java.awt.*; |
Output will be displayed as: