--- In [email protected], "mockey_a" <[EMAIL PROTECTED]> wrote: > But I found the mistake. The mouse is exactly over 1 pixel. Now Sean > defines the region that's going to be enlarged: > xmouse-nRect/nZoom,ymouse-nRect/nZoom,;;+ > nRect/nZoom*2,nRect/nZoom*2 > that's 10 pixel up and left and then 20 pixels down and right, which > gives you a 20x20 pixel section.
I don't quite understand it. Would it mean, then, 0 pixel up and 2*0 pixel down is 0 pixel? 1 pixel up and 2 pixel down is 2 pixel, not 3 pixel? Anyway, adding 1 pixel really improves the behavior. So, possibly my conception of pixel is wrong, I tend to think pixel as a mathematical point which I always felt may not be quite correct. > I think it might be better to define a pixel-radius and a zoom- > factor for the script to avoid rounding mistakes, like a radius of > 10 and a zoom factor of 5, which would give you a section of 21x21 > and an enlarged picture of 105x105. There were two choices from the start: 1) based on the big rectangle: intuitive as this one is what we see 2) based on the small rectangle: precise as no division involved I took the seemingly intuitive approach as this is simpler to imagine and it's quite straightforward to convert this to the small-rect base. OK, I'll upload a new one which is somewhat mixed approach: e.g., nZoom = 5 nRect = 100/2/nZoom So, roughly specify the big rectangular dimension, which can be smaller maximally by 2*nZoom - 1: specify 100, will get 100 specify 109, will get 100 specify 110, will get 110 Sean Attention: PowerPro's Web site has moved: http://www.ppro.org Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/power-pro/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
