aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes AffineTransform make an image move Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "AffineTransform make an image move" Watch "AffineTransform make an image move" New topic
Author

AffineTransform make an image move

Mauricio Lopes
Greenhorn

Joined: Aug 04, 2009
Posts: 12
I've been trying to make an image rotate in a panel. I did it. But also i want the image to make a translation.

Here is the code i tryed at paintComponent() :

//////////////////////////

Graphics2D g2 = (Graphics2D) g ;
AffineTransform at = new AffineTransform() ;

// at.rotate ( angle in radians ) ;
at.rotate( this.getAngulo(1, 1) ) ;

g2.drawImage(imgemFlecha, at, this);

/////////////////////////////


I cant change image x,y doing this drawImage(). I want to make that change.

Any suggestions ?
Mauricio Lopes
Greenhorn

Joined: Aug 04, 2009
Posts: 12
??
Craig Wood
Ranch Hand

Joined: Jan 14, 2004
Posts: 1535
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19538
    
  16

Mauricio Lopes wrote:??

http://faq.javaranch.com/java/PatienceIsAVirtue


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: AffineTransform make an image move
 
Similar Threads
Rotating a JWindow with multiple JPanels
Resetting or Undoing AffineTransforms
Wanted: Java2D example of zooming and panning with scroll bars
JPanel Form Problems
Image Rotation