Solved

Java2D scale help

Posted on 2006-11-11
3
408 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Delphi Seattle StructureView color 1 21
maven not picking latest jar instead picking old jar from .m2 12 42
junit example issue 2 22
IBM TS2900 (3572) Tape Autoloader Java? 12 51
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
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 one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:

679 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