Results 1 to 6 of 6
Thread: Quick rotating images question
- 04-10-2011, 05:06 AM #1
Member
- Join Date
- Apr 2011
- Posts
- 48
- Rep Power
- 0
Quick rotating images question
im trying to make an image rotate around a point but i dont know how to do it because when i try to do this:
t = some AffineTransformation
t.translate(Math.round(bone.getBoneX()), Math.round(bone.getBoneY()));
t.rotate(bone.getBoneRotation());
g2.drawImage(img,t,this);
i get my rotated image but it rotates around its (0,0) corner point and i need help knowing how to fix this.
- 04-10-2011, 05:09 AM #2
Look into the AffineTransform methods:
AffineTransform (Java Platform SE 6)
Look for the multiple overloaded methods of rotate().
- 04-10-2011, 05:32 AM #3
Member
- Join Date
- Apr 2011
- Posts
- 48
- Rep Power
- 0
re
that kind of helped but i still dont know how to implement it. For example, i want my image to rotate say at (5,5) from the left top corner of the image
- 04-10-2011, 05:37 AM #4
-
As already mentioned, there is an overload of AffineTransform.getRotateInstance(...) that takes three double parameters, an angle and the x and y center of rotation. If you've tried this and it fails, at this point you should show us your code because otherwise there's no way for anyone to guess what you're doing wrong.
- 04-10-2011, 05:47 AM #6
Member
- Join Date
- Apr 2011
- Posts
- 48
- Rep Power
- 0
Similar Threads
-
quick question
By biggerthanblue in forum New To JavaReplies: 2Last Post: 04-10-2011, 04:33 AM -
Really Quick question
By Ryan10 in forum New To JavaReplies: 63Last Post: 03-02-2011, 02:11 AM -
Quick question
By sAntA199 in forum New To JavaReplies: 2Last Post: 12-09-2009, 03:01 AM -
Rotating Images
By Unome in forum Java AppletsReplies: 3Last Post: 03-30-2009, 04:55 PM -
One last quick question
By jigglywiggly in forum New To JavaReplies: 7Last Post: 01-26-2009, 08:53 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks