SHARE
TWEET

Untitled

a guest Jun 26th, 2019 49 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public void drawIt(Graphics graphics)
  2. {
  3.     Dimension size = label.getPreferredSize();
  4.     BufferedImage image = new BufferedImage(size.width, size.height, BufferedImage.TYPE_INT_ARGB);
  5.  
  6.     Graphics imageGraphics = image.createGraphics();
  7.     label.paint(imageGraphics);
  8.     graphics.drawImage(image, 100, 100, null);
  9.  
  10.     imageGraphics.dispose();
  11. }
  12.      
  13. label.paint(graphics);
  14.      
  15. label.paint(graphics);
  16.      
  17. graphics.translate(100, 100);
  18. label.paint(graphics);
  19. graphics.translate(-100, -100); //set origin back to 0, 0 for following calls
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top