Currently viewing: GipsySoft » Front Page» Articles

DrawBitmap

Draw a HBITMAP on to a HDC.

void DrawBitmap( int x, int y, HDC hdc, HBITMAP hbm );

Return value

No return value

Example
This what a typical usage might look like in a WM_PAINT message handler

case WM_PAINT:
  {
    PAINTSTRUCT ps;
    BeginPaint( hwnd, &ps );
    HBITMAP hbm = LoadBitmap( GetModuleHandle( NULL )
        , MAKEINTRESOURCE( IDB_TEST ) );

    DrawBitmap( 0, 0, ps.hdc, hbm );

    DeleteObject( hbm );

    EndPaint( hwnd, &ps );
  }
  break;

 

Click to view the source code

See also DrawBitmapStretched DrawTiledBitmap