Guest User

Untitled

a guest
Jan 23rd, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. void SnapCourt()
  2. {
  3. HDC hScreenDC, hCaptureDC, hSavedDC;
  4. HBITMAP hCaptureBmp;
  5. RECT rect;
  6.  
  7. GetWindowRect(GetDesktopWindow(), &rect);
  8. hScreenDC = GetWindowDC(0);
  9. hCaptureDC = CreateCompatibleDC(hScreenDC);
  10. hCaptureBmp = CreateCompatibleBitmap(hScreenDC, courtRect.right - courtRect.left, courtRect.bottom - courtRect.top);
  11. hSavedDC = (HDC) SelectObject(hCaptureDC, hCaptureBmp);
  12. BitBlt(hCaptureDC, 0, 0, courtRect.right - courtRect.left, courtRect.bottom - courtRect.top, hScreenDC, courtRect.left, courtRect.top, SRCCOPY);
  13. ReleaseDC(0, hScreenDC);
  14. SelectObject(hSavedDC, hCaptureBmp);
  15. SaveBitmap("court.bmp", hCaptureBmp);
  16. DeleteObject(hCaptureBmp);
  17. }
Add Comment
Please, Sign In to add comment