> xNew2: using screen rectangle (l2,t3,r2,b2) > > xNew2= x*((r2-l2)*10 +5)/(r1-l1)/10 +offset > > The above avoids floating calcs.
This should work in all realistic situations. But it is possible for the first multiplication to overflow if x and r2 are very large, which would only happen with artifical coordinates. An alternative to floating point to cover this case is to use 64 bit result for multiplication, and in fact Windows has a builtin MulDiv function which does this. > > I never thought about allowing the user to enter the ending > rectangle, The idea of having both the starting and ending coordinate systems is to be able to cover many cases - move from screen coordinates to coordinates withing work area - move from idealized coordinates like (0, 0, 10000, 10000) to any of screen, work area, or within-another-window coordinates. - move between different monitors each with their own base rectangles I know the above is easy enough to do in a script, but I may implement a win. function for convenience 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/
