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.
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:
now you saved a portion of the window in backupbitdc. on WM_PAINT you have to put it back on other coordinates:
----------snip-------------- .data? backupbit dd ? backupbitdc dd ? windowdc dd ? ----------snip-------------- .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
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
.elseif uMsg==WM_PAINT invoke BitBlt,windowdc,dststartx,dststarty,dstwidth,dstheight,backupbitdc,srcstartx+1,srcstarty,SRCCOPY
If you have a problem with bitblt, Iīm have a test code about bitblts (Itīs a CAD prototype project). Get it: Test18.zip (maybe you will need to use right button, save target as...) If you didnīt like, please, tell me. If you liked, please, tell me. :eek: