Create "invisible" graphics

1.1k views Asked by At

I need Your help in generating offscreen images from graphics class and converting them to binary data without setting them visible on screen. I want to generate large amounts of labels and send them to a printer as binary data. If i create the image, show it on screen and then send it, everything is ok, but i generate 100 labels in one minute and it is annoying when they flicker on the screen of my java aplication. I want it to be generated by a seperate thread, without visible efects.
If i don't show them, the labels are send black. I tried to generate them, and then show them off screen, that did not match my expectations. Is there a way to generate "invisible" images from Graphics2d?? or Is there another way You could suggest me?

Thank You in advance Qba

1

There are 1 answers

3
aioobe On

You can use a BufferedImage and use getGraphics() to get hold of a Graphics2D object that paints onto this image.

If you're after painting GUI components (if your "label" refers to JLabel for instance) you could have a look at these questions: