#include <stdio.h> #include <Windows.h>
int main(void) { HBITMAP hbmp; HDC hdc, hdcMem;
hdc = GetDC(NULL); hbmp = CreateCompatibleBitmap(hdc, 300, 250); hdcMem = CreateCompatibleDC(hdc); SelectObject(hdcMem, hbmp);
BitBlt(hdcMem, 0, 0, 300, 250, hdc, 800, 600, SRCCOPY); DeleteDC(hdcMem); //DeleteObject(hbmp);
OpenClipboard(NULL); EmptyClipboard(); SetClipboardData(CF_BITMAP, hbmp); CloseClipboard();
ReleaseDC(NULL, hdc); }
|