I would like to know why the hell this isn't working. i have some examples of it but cant get it to work. Will someone please take a look?
Hi, xandaz!
Look Windows Creator (http://masm32.com/board/index.php?topic=6275.msg79811#msg79811) --> Background
I dont think i understand and some of the files you uploaded seem to be damaged,
isnt it simpler to place all drawing code between GetDC and ReleaseDC and delete objects last in code?
.if wParam==MK_LBUTTON;
invoke CreatePen,PS_SOLID,4,ccolor.rgbResult
invoke SelectObject,hBackDC,eax
invoke DeleteObject,eax;???wrong place deleting object
mov eax,lParam
mov ebx,eax
movzx eax,ax
shr ebx,16
invoke LineTo,hBackDC,eax,ebx
invoke GetClientRect,hCanvas,addr rect
invoke InvalidateRect,hCanvas,addr rect,TRUE
.endif
https://docs.microsoft.com/en-us/windows/win32/gdi/drawing-with-the-mouse (https://docs.microsoft.com/en-us/windows/win32/gdi/drawing-with-the-mouse)
Thanks... i got it to work but ccolor.rgbResult isn't returning any values... Why is that?
Sorry. My bad. I was creating the bitmap with the compatible dc instead of the window dc. Thats why it came in black and white. Thanks y'all