Programming API VC ++ win32: how can I get an image from the clipboard and display it in windows?

Use SelectObject () in your DC memory to select a bitmap. It puzzles me. I read msdn but still don't know how to populate the second SelectObject () parameter.

+3
source share
1 answer

Call OpenClipbard()to open the clipboard and call GetClipboardData()with type CF_BITMAPto get the descriptor of the image data stored in the clipboard. If there is no image on the clipboard, a NULL descriptor will be returned.

WM_PAINT BeginPaint(), CreateCompatibleDC(), . SelectObject() DC, , , , BitBlt(), DC DC. - DeleteDC(), DC, EndPaint() .

, CloseClipboard(), . , , CloseClipboard(), . , , .

+7

Source: https://habr.com/ru/post/1719479/


All Articles