The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: cman on August 12, 2008, 08:03:33 PM

Title: BitBlt example
Post by: cman on August 12, 2008, 08:03:33 PM
Does anyone have some example code using the BitBlt API? Thanks! :bg
Title: Re: BitBlt example
Post by: Vortex on August 12, 2008, 08:13:53 PM
Iczelion's Win32 Assembly Tutorials

Tutorial 25: Simple Bitmap (http://win32assembly.online.fr/tut25.html)


.if uMsg==WM_CREATE
      invoke LoadBitmap,hInstance,IDB_MAIN
      mov hBitmap,eax
   .elseif uMsg==WM_PAINT
      invoke BeginPaint,hWnd,addr ps
      mov    hdc,eax
      invoke CreateCompatibleDC,hdc
      mov    hMemDC,eax
      invoke SelectObject,hMemDC,hBitmap
      invoke GetClientRect,hWnd,addr rect
      invoke BitBlt,hdc,0,0,rect.right,rect.bottom,hMemDC,0,0,SRCCOPY
      invoke DeleteDC,hMemDC
      invoke EndPaint,hWnd,addr ps