Solved

Java2D scale help

Posted on 2006-11-11
3
407 Views
Last Modified: 2013-11-22
Hi,
    How come when I use g2d.scale(x,y), it moves my object to another location? How do I bring it back to the original location? thanks!
0
Comment
Question by:azcalv408
3 Comments
 
LVL 92

Accepted Solution

by:
objects earned 75 total points
ID: 17924372
because the scaling is relative to 0,0
you nned to 1st translate it so it is centred around origin, scale it, then translate it back.
0
 

Author Comment

by:azcalv408
ID: 17925853
sorry for late reply...do you think this is the same for rotation and shear? thanks
0
 
LVL 6

Expert Comment

by:SamsonChung
ID: 17931587
YES

Think about X,Y coordinates......

start point, end pt, you will have to translate it back and forth with formulars......
0

Featured Post

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Delphi: making a BW image transparent 10 62
ejb example issues 3 28
swing controls 2 16
delphi popmenu non latine charcters 3 13
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:

827 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question