屏幕吸色器的實現

關鍵地方
1、::SetCapture(this->m_hWnd);ReleaseCapture();
2、::GetDC(NULL);獲得屏幕DC
COLORREF crtTMPColor;
CRect rect;
HDC hDC;
hDC = ::GetDC(NULL);
::GetWindowRect(this->m_hWnd, &rect);
crtTMPColor = GetPixel(hDC, (point.x+rect.left), (point.y+rect.top));
::ReleaseDC(NULL, hDC);
SetColor(crtTMPColor);
運行後截圖,小巧適用
在這裏插入圖片描述
源碼下載地址
鏈接:https://pan.baidu.com/s/1fjGAk89DTE1cHB98k-q0xw
提取碼:10tz
或者
https://download.csdn.net/download/qq_23927175/11103430

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章