> It's working fine. But the more I do the zoom-in and zoom-out clicks
> the images gets distorted. I understand its because of the scale. i am
> not able to get back to the exact zoomed-out place after I zoomed-in.

Signature
Antti S. Brax Rullalautailu pitää lapset poissa ladulta
http://www.iki.fi/asb/ http://www.cs.helsinki.fi/u/abrax/hlb/
[1385 messages expunged from folder "Spam"]
> No. It is because you perform operations on an already
> manipulated image. Keep a reference to the original image
> and scale it instead and store the current scale in a
> variable.
In addition, note that 0.5 and 1.5 are NOT reciprocals of each other.
If you want a zoom in followed by a zoom out to get you back to normal,
then your scaling factors need to be reciprocals of each other. If you
scale something by 0.5, and then by 1.5, you'll get a final scale factor
of 0.75, NOT 1.0.

Signature
www.designacourse.com
The Easiest Way To Train Anyone... Anywhere.
Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation
Antti S. Brax - 16 Jun 2005 06:45 GMT
cdsmith@twu.net wrote in comp.lang.java.programmer:
> In addition, note that 0.5 and 1.5 are NOT reciprocals of each other.
> If you want a zoom in followed by a zoom out to get you back to normal,
> then your scaling factors need to be reciprocals of each other. If you
> scale something by 0.5, and then by 1.5, you'll get a final scale factor
> of 0.75, NOT 1.0.
Exactly. If you want to scale something with factor X, then scaling
back is done with factor 1/X.

Signature
Antti S. Brax Rullalautailu pitää lapset poissa ladulta
http://www.iki.fi/asb/ http://www.cs.helsinki.fi/u/abrax/hlb/
[1385 messages expunged from folder "Spam"]