java - Crop a photo to be 600x600 around a point (x,y) -
I need some logical help with my program. I need to keep the 600x600 photo around the point (x, y). The thing I need help with is when the point is near the edge, then how can I move the crop area, so that it fits inside the picture.
I have the code:
buffled image fail IMG = capture.getSubimage (Math.max (0, x - 300), Math. Max (0, y - 300), 200, 200);
As far as I can see, the code works for the top and the left side, but I have no clue how to apply the same effect on the bottom and the right.
If it helps, I want to capture the screen and crop the picture around the mouse (x, y).
Thanks
BufferedImage original image = reed image (input file location); / ** * Image Cropping Parameters * / Int Fahrenheit = 600; Int crop withth = 600; Int cropStartX = 50; Int cropStartY = 50; Buffard image processed image = crop image (original image, cropwhite, crophit, crop startx, crop start);
Comments
Post a Comment