CropImageFilter(int x, int y, int w, int h)
First, load the image from folder. Here's is the method I prepared.
private Image loadImage(String img){
return getImage(app.getDocumentBase(),"img/"+img);
}
For eclipse IDE, I put my images file inside the src/img package.
After load the image, let's say "image_want_chop.png" is loaded and chop it with following code.
Image originalImage = loadImage("image_want_chop.png");
ImageFilter imageFilter = new CropImageFilter(x,y,width,height);
Image choppedImage = createImage(new FilteredImageSource(originalImage.getSource(),
imageFilter ));
Thank you for reading.

0 件のコメント:
コメントを投稿