| Method | Steps | Time (sec) | Context switches | |--------|-------|------------|------------------| | Save as file → attach | 5 | 18.4 | 4 | | | 2 | 7.2 | 1 |
HBITMAP hBitmap = CreateCompatibleBitmap(hdcScreen, width, height); SelectObject(hdcMem, hBitmap); BitBlt(hdcMem, 0, 0, width, height, hdcScreen, 0, 0, SRCCOPY); copy screenshot to clipboard windows
int width = GetSystemMetrics(SM_CXSCREEN); int height = GetSystemMetrics(SM_CYSCREEN); | Method | Steps | Time (sec) |
DeleteDC(hdcMem); ReleaseDC(NULL, hdcScreen); int width = GetSystemMetrics(SM_CXSCREEN)
#include <windows.h> #include <wingdi.h> void CaptureScreenToClipboard() HDC hdcScreen = GetDC(NULL); HDC hdcMem = CreateCompatibleDC(hdcScreen);