Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
CaptureImageOrColor : Continuous recording of the dimensions
#12
Dear Gintaras,
I need to continuously monitoring, while the mouse is moved, the pointer position. Therefore, I made three modifications to your code, as it follows :

Function tempf08
Code:
Copy      Help
,SetCapture hDlg
;,r.right=66; r.bottom=86; OffsetRect &r -d.xs+d.xmagn -d.ys; InvalidateRect hDlg &r 0 ;;erase magnifier
,r.right=66; r.bottom=100; OffsetRect &r -d.xs+d.xmagn -d.ys; InvalidateRect hDlg &r 0 ;;erase magnifier
,
,case WM_MOUSEMOVE
,xm p hDlg 1
,dc=GetDC(hDlg)
,if(hDlg!=GetCapture) ;;draw magnifier/color
;,,r.right=66; r.bottom=86; OffsetRect &r -d.xs+d.xmagn -d.ys ;;calc frame
,,r.right=66; r.bottom=100; OffsetRect &r -d.xs+d.xmagn -d.ys ;;calc frame
,,if(PtInRect(&r p.x p.y)) d.xmagn=iif(d.xmagn 0 300); InvalidateRect hDlg &r 0; goto gr ;;move away
,,z=GetStockObject(BLACK_BRUSH); FrameRect dc &r z; r.top+65; FrameRect dc &r z ;;draw frames
,,StretchBlt(dc r.left+1 r.top-64 64 64 d.bms.dc p.x p.y 16 16 SRCCOPY) ;;draw magnifier
;,,draw color
;,,_s.format("0x%06X" GetPixel(d.bms.dc p.x p.y))
,,_s.format("0x%06X[]%s" GetPixel(d.bms.dc p.x p.y) F"{p.x}-{p.y}")
,,InflateRect &r -1 -1; FillRect dc &r 1+COLOR_WINDOW; r.left+2; r.top+2
,,z=SelectObject(dc _hfont); DrawTextW dc @_s -1 &r 0; SelectObject(dc z)


It works satisfactorily. However, I would appreciate your comments. Thank you in advance.


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)