Posted By:
ayman_elgharabawy
Posted On:
Saturday, October 26, 2002 08:54 AM
all i want to to do is to make afilter on a specific part of any image here is my part of code.. class RedBlueSwapFilterD extends RGBImageFilter { imageVector iv=new imageVector(); public RedBlueSwapFilterD() { // The filter's operation does not depend on the // pixel's location, so IndexColorModels can be // filtered directly. canFilterIndexColorModel = false; } public int filterRGB(int x, int y, int rgb) { return ((rgb & 0xff00ff00) | ((rgb & 0xff0000) >> 16) | ((rgb & 0xff) < < 16)); } } //-----------------------------------------------//
More>>
all i want to to do is to make afilter on a specific part of any image
here is my part of code..
class RedBlueSwapFilterD extends RGBImageFilter {
imageVector iv=new imageVector();
public RedBlueSwapFilterD() {
// The filter's operation does not depend on the
// pixel's location, so IndexColorModels can be
// filtered directly.
canFilterIndexColorModel = false;
}
public int filterRGB(int x, int y, int rgb) {
return ((rgb & 0xff00ff00)
| ((rgb & 0xff0000) >> 16)
| ((rgb & 0xff)
<
< 16));
}
}
//-----------------------------------------------//
here is part of my application..
RedBlueSwapFilterD colorfilterdimension = new RedBlueSwapFilterD();
image = getImage(getDocumentBase(),"1532z.jpg");
colorfilterdimension.filterRGBPixels (20,30,30,40,ai,0,378);
img2 = createImage(new FilteredImageSource(image.getSource(),colorfilterdimension));
g.drawImage (img1,100,100,this);
///---------------------------
i have run time error withfilterRGBPixels pls help
thankx
<<Less