How do Painting/drawing apps do the zooming? I've been looking into it but couldn'tfind anything on the subject. I looked in the skd but alli could find was the ScaleWindow/ViewportExtEx. I tried it out but no changes made. Does anyone have any tips on this subject? thanks
Normal viewing = draw each pixel 1x1
Zoom 2x = draw each pixel 2x2
Zoom 3x = draw each pixel 3x3
Zoom 10x = draw each pixel 10x10
That's all you need to do - just draw each of the pixels 'bigger.'
I'd use StretchBlt :wink
Sounds simple. Except that if i make a pen larger than one and if it's not straight it doesnt really work does it? Couldnt i use setworldtransformand other scaling functions? Do you know how other apps do it? Do you any examples? Thanks Ted
Having thought a little about it it would be best to use stretching. Thanks ted. I think i just have to map the mouse to the pixels size right? Thanks again
Quote from: xandaz on September 03, 2011, 01:53:55 PM
Having thought a little about it it would be best to use stretching. Thanks ted. I think i just have to map the mouse to the pixels size right? Thanks again
yes, simply divide the mouse's x and y position by the current scale factor (2,4,...). Using this coordinates, you an draw to your bitmap/DC.
thanks guys ...you're the best...