> Then, cut out the large-rect by 1 each side which make large-rect of
> (-8, -8) ~ (8, 8)

Oops, this should be (-9, -9) ~ (9, 9), of course.

> 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.

I did a quick test, and no, mapping to the negative coordinate seems
not allowed. Then, the next best is to shift (1, 1) of stretched (-2,
-2) ~ (0, 0) and read the color at (-1, -1) on screen:

nZoom = 5
nRect = 100/2/nZoom*nZoom

hWnd.size((nRect - nZoom/2) * 2, (nRect - nZoom/2) * 2)
hWnd.move(xmouse - (nRect - nZoom/2), ymouse - (nRect - nZoom/2))

StretchBlt(
hDC_TT, 0, 0, nRect * 2, nRect * 2,
hDC_SC,xmouse-nRect/nZoom,ymouse-nRect/nZoom,nRect/nZoom*2,nRect/nZoom*2)

GetPixel(xmouse - 1, ymouse - 1)

It seems to work fine.

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/
 



Reply via email to