pen_BMP.cpp
Upload User: dq031136
Upload Date: 2022-08-08
Package Size: 802k
Code Size: 0k
Development Platform:

C++ Builder

  1. HBITMAP hBitmap;
  2. HDC hDC;
  3. HDC hMemDC;
  4. //  Load the bitmap into memory
  5. hBitmap = LoadBitmap( hInst, "pen" );
  6. //  Paint the bitmap onto the MemDC and then the screen
  7. hDC = GetDc( hWnd );
  8. hMemDC = CreateCompatibleDC( hDC);
  9. SelectObject( hMemDC, hBitmap );
  10. BitBlt( hDC, 10, 10, 60, 60, hMemDC, 0, 0, SRCCOPY );
  11. DeleteDC( hMemDC );
  12. ReleaseDC( hWnd, hDC );
  13. DeleteObject( hBitmap );