To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.
How do I get the selected crop image in JCrop ? and save it on my local drive ?Anyone?
JCrop is not return with the image selected, JCrop is only return with the posisition of the image selected.you can use another tools to crop the file and save it.
I user ImgScalr library :
BufferedImage img = ImageIO.read(new File(filenameSelected)); BufferedImage imgRs = Scalr.crop(img, selectionLast.getX(), selectionLast.getY(), selectionLast.getWidth(), selectionLast.getHeight(), Scalr.OP_ANTIALIAS);
ByteArrayOutputStream imagebuffer = new ByteArrayOutputStream(); ImageIO.write(imgRs, "png", imagebuffer);
inputStream = new ByteArrayInputStream( imagebuffer.toByteArray());
wow.. thanks for your help.. HAHA..I havent known that sir..