Hello to everybody. Could you help me. How to make shifting a content of rectangle area of the window (left,right,up,down 1 pixel). Thanks.
Posted on 2001-03-25 23:06:00 by lekimus
if someone knows a better possiblity then post it here. here's my solution: you have to create a new device context where you can save that rectangle what you want to move. after that just BitBlt that device context into the window you want it to be in the WM_PAINT message. that's all. here are some code snippets:

  backupbit     dd ?
  backupbitdc   dd ?
  windowdc      dd ?

.elseif uMsg==WM_CREATE
invoke GetDC,hWin
mov windowdc,eax
invoke CreateCompatibleDC,windowdc
mov backupbitdc,eax
invoke CreateCompatibleBitmap,windowdc,width,height
mov backupbit,eax
invoke SelectObject,backupbitdc,backupbit
invoke BitBlt,backupbitdc,dststartx,dststarty,dstwidth,dstheight,windowdc,srcstartx,srcstarty,SRCCOPY
now you saved a portion of the window in backupbitdc. on WM_PAINT you have to put it back on other coordinates:

.elseif uMsg==WM_PAINT
invoke BitBlt,windowdc,dststartx,dststarty,dstwidth,dstheight,backupbitdc,srcstartx+1,srcstarty,SRCCOPY
this will put your rectangle one pixel to the right. actually i'm not sure if this is what you asked for. :D hope i could help you. bye
Posted on 2001-03-26 08:55:00 by [SaFc0n]
If you have a problem with bitblt, Im have a test code about bitblts (Its a CAD prototype project). Get it: Test18.zip (maybe you will need to use right button, save target as...) If you didnt like, please, tell me. If you liked, please, tell me. :eek:
Posted on 2001-03-27 05:02:00 by wolfao