in all of my programs where i used a bitmap and displayed it on the whole window, the bitmap isn't shown correctly. this is a piece of the source and above is the problem presented in a picture.

rc-file:
MYBMP BITMAP MOVEABLE PURE LOADONCALL DISCARDABLE "FILE0002.BMP"

asm-file:
invoke LoadBitmap, hInst,addr backg
      mov hbmp,eax
      invoke CreatePatternBrush, eax
      mov wc.hbrBackground,eax
Posted on 2001-05-30 12:20:00 by [-alloces-]
hm iīm not 100% sure if u can go this way but i donīt think so u might try this instead in your WndProc

 LOCAL ps:PAINTSTRUCT
 LOCAL hdc:HDC
 LOCAL hMemDC:HDC
 LOCAL rect:RECT
.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
.elseif uMsg==WM_DESTROY
      invoke DeleteObject,hBitmap
and so on ....
Posted on 2001-05-30 12:54:00 by Allanon
you know, the weird thing is that it works usually. the problem only appears when i don't run my compiler/linker. if i compile the source and start the exe, everything works fine. if i restart my computer without running the assembler compiler, it doesn't work. i just don't understand that....
Posted on 2001-05-31 03:48:00 by [-alloces-]