Solved

Java2D scale help

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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
servlet doXXX methods 3 47
Should localization be done inside spring controller 5 25
RESTRequest Parameter 4 30
servlet filter example 37 58
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
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:
This video teaches viewers about errors in exception handling.

815 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now