This is an image captured from a web cam, and save it to an label. no url used. can i get the image from the label and save it to mysql? NOT USING URL
maybe with getIcon() method?
This is an image captured from a web cam, and save it to an label. no url used. can i get the image from the label and save it to mysql? NOT USING URL
maybe with getIcon() method?
is how to get image from label
You can create a BufferedImage
from any Swing component. The basic code is:
BufferedImage image = new BufferedImage(label.getWidth(), label.getHeight(), BufferedImage.TYPE_INT_RGB);
Graphics2D g2d = image.createGraphics();
label.paint( g2d );
g2d.dispose();
Or you can check out Screen Image which adds extra features to the above code to make it more flexible. Then you can just use:
BufferedImage image = ScreenImage.createImage( label );