pen_bmp.cpp

来自「c c++最佳编程 1000 多个小技巧 源码」· C++ 代码 · 共 17 行

CPP
17
字号
HBITMAP hBitmap;
HDC			hDC;
HDC			hMemDC;

//  Load the bitmap into memory

hBitmap = LoadBitmap( hInst, "pen" );

//  Paint the bitmap onto the MemDC and then the screen

hDC = GetDc( hWnd );
hMemDC = CreateCompatibleDC( hDC);
SelectObject( hMemDC, hBitmap );
BitBlt( hDC, 10, 10, 60, 60, hMemDC, 0, 0, SRCCOPY );
DeleteDC( hMemDC );
ReleaseDC( hWnd, hDC );
DeleteObject( hBitmap );

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?