|
Hello,
I have a question on the interrelation between
rotation and scaling.
When I call g2.rotate(theta) it makes a change to
the scaling.
I find this surprising, I thought that I could
do a rotation independent of the scaling.
Can anyone explain this? I'm using JDK 1.3 on NT
4.
Thank you.
========= start code snippet
final
double ONE_DEGREE = Math.PI / 180;
AffineTransform at = g2.getTransform( ); double
xScale = at.getScaleX( );
double yScale = at.getScaleY( );
System.err.println(" setTransform( ) 1 xScale yScale: " +
xScale + " " + yScale);
g2.rotate(ONE_DEGREE * 45);
at =
g2.getTransform( );
xScale =
at.getScaleX( );
yScale = at.getScaleY( );
System.err.println(" setTransform( ) 2 xScale yScale: " +
xScale + " " + yScale);
========= end code snippet
Here is the output:
setTransform( ) 1 xScale yScale:
1.0 1.0
setTransform( ) 2 xScale yScale: 0.7071067811865476 0.7071067811865476 |
- Re: [JAVA2D] Rotation and Scaling Ted Hill
- Re: [JAVA2D] Rotation and Scaling Jim Bucher
- [JAVA2D] Rotation and Scaling Thomas E Deweese
- Re: [JAVA2D] Rotation and Scaling Yang-Ming Zhu
- Re: [JAVA2D] Rotation and Scaling Thomas E Deweese
- Re: [JAVA2D] Rotation and Scaling Yang-Ming Zhu
- Re: [JAVA2D] Rotation and Scaling Yang-Ming Zhu
- Re: [JAVA2D] Rotation and Scaling Jim Graham
