--- In [email protected], "mockey_a" <[EMAIL PROTECTED]> wrote: > This gets too complicated for me for now. Still tired from the > weekend. I will think this over, when my more of my remaining brain > cells are working. For the time being, I'm satisfied with the cursor > being over the center of the zoomed pixel.
I think the easiest way to do is just to shift the stretched image, then cut the large rectangle appropriately. For example, nZoom = 2 small rect: (-5, -5) ~ (5, 5) large rect: (-10, -10) ~ (10, 10) Then, the stretch image of the pixel square (0, 0) ~ (1, 1) would become the pixel squres (0, 0) ~ (2, 2). So, shift the stretch image of the small-rect by (-1, -1) (:I think the shift should be to the left/up, as the representing point (x, y) is the (left, top) of the pixel square it represents). Then, the image in large-rect should be (-11, -11) ~ (9, 9) Then, cut out the large-rect by 1 each side which make large-rect of (-8, -8) ~ (8, 8) So, basically something like this: hWnd.size(2 * (nRect - nZoom/2), 2 * (nRect - nZoom/2)) hWnd.move(xmouse - (nRect - nZoom/2), ymouse - (nRect - nZoom/2)) StretchBlt( hDC_TT, 0 - nZoom/2*2, 0 - nZoom/2*2, nRect * 2, nRect * 2, hDC_SC,xmouse-nRect/nZoom,ymouse-nRect/nZoom,nRect/nZoom*2,nRect/nZoom*2) However, I'm not sure if it's poosible to map to the negative coordinates of the target DC (hDC_TT), and the formula looks awful. So, I think I better stick with the current form. 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/
