Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Graphics2D g2 = (Graphics2D) g;
- Composite oldComposite = g2.getComposite();
- g2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER));
- // --- mine ---
- AffineTransform at = new AffineTransform();
- at.translate(position.x-Demo2.imageWidth/2, position.y-Demo2.imageHeight/2);
- at.rotate(PositioningDemoServlet.heading*Math.PI/180d, Demo2.imageWidth/2, Demo2.imageHeight/2);
- g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
- g2.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BICUBIC) ;
- g2.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY) ;
- // at.rotate(Math.PI/4d);
- System.out.println("painted @ "+position.x+", "+position.y);
- g2.drawImage(Demo2.deepCopy(Demo2.imageToPaint), at, null);
- // --- end mine ----
- g2.setPaint(getBackColor());
- // g.fillOval(position.x - size_h, position.y - size_h, size, size);
- g2.setComposite(oldComposite);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement