Transforms

by ahanak on July 25th, 2010
No notes
Syntax: Java 5
Show lines - Hide lines - Show in textbox - Download
1.5.0/docs/api/java/awt/image/BufferedImage.html">BufferedImage buf = getImage();
int x = buf.getWidth() / 2;
int y = buf.getHeight() / 2;
 
1.5.0/docs/api/java/awt/Graphics2D.html">Graphics2D g2 = buf.createGraphics();
g2.translate(x, y);
g2.rotate(1.5.0/docs/api/java/lang/Math.html">Math.toRadians(90);
g2.translate(-x, -y);
 
//dalsze rysowanie
...
 
g2.dispose();

Leave a Reply

Note: XHTML is allowed. Your email address will never be published.

Subscribe to this comment feed via RSS