Hi all,
i m getting problem using getSubimage(), the task that i have to performed is to find the first pixel from 4 sides i.e top, bottom,left,right
the code is as follow
return new_image;
}
public static void main(String args[]) {
scanPixel sp = new scanPixel();
}
}
if anyone knows the solution please rply asap.
thanks in advance.
Michael Dunn
Ranch Hand
Joined: Jun 09, 2003
Posts: 4632
posted
0
most forums have a code button that when clicked produce some code tags that you paste your code between,
or, paste your code, highlight it, then click the code button.
try editing your post (edit button), to add code tags so we can read it in a format that is easy on our eyes
e.g. this is much easier on the eyes
than this
class FirstProgram{
public static void main(String[] args){
System.out.println("Hello World");
}
}
Alan Mehio
Ranch Hand
Joined: Apr 04, 2005
Posts: 70
posted
0
Hi,
I am not sure if this help; I went through your code quickly and I realized based on your question below
i m getting problem using getSubimage(), the task that i have to performed is to find the first pixel from 4 sides i.e top, bottom,left,right
So you have the new BufferedImage from the method getSubimage(). So what make a problem if the getRBG(x,y) if x and y are the coordinate point on the image
so the top left corner has a point (0,0) and the top right corner has (subImage.getWidth(),0) etc..
I am not sure if this is correct answer but it may help
I have looked at the API doc for hte getRBG(x,y) method which return the pixel at specific point
Have you looked at the method public int[] getRGB(int startX, int startY, int w, int h,
int[] rgbArray, int offset, int scansize) in the BufferedImage