Hi everybody.
I'm trying to scroll an image like a cilinder, i had an idea using bitblt but i think something was wrong in the implementation:
Paint_Proc proc hWin:DWORD, hDC:DWORD, movit:DWORD
LOCAL hOld :DWORD
LOCAL hNew :DWORD
LOCAL memDC:DWORD
LOCAL memDCBack:DWORD
invoke CreateCompatibleDC,hDC
mov memDC, eax
invoke SelectObject,memDC,hBmp
mov hOld, eax
invoke CreateCompatibleDC,hDC
mov memDCBack, eax
invoke SelectObject,memDC,hBmp
mov hNew, eax
.if movit == 0
invoke BitBlt,hDC,10,10,768,576,memDC,0,0,SRCCOPY
.else
mov var3, 0
.while var3 < 2 ;<< set the number of times image is looped
mov var1, 0
.while var1 < 768 ;<< Bitmap width
invoke BitBlt,memDCBack,0,0,767,576,memDC,1,0,SRCCOPY ;take from pixel 1 to width
invoke BitBlt,memDCBack,767,0,1,576,memDC,767,0,SRCCOPY ;take pixel 1 to last column
invoke BitBlt,hDC,10,10,768,576,memDCBack,var1,0,SRCCOPY ;draw the image
inc var1
.endw
inc var3
.endw
.endif
invoke SelectObject,hDC,hOld
invoke DeleteDC,memDC
invoke SelectObject,hDC,hNew
invoke DeleteDC,memDCBack
return 0
Paint_Proc endp
(The original code was taken from a masm32 example)
I think bitblt can copy from the second column to the end of the bitmap, then copy the first column to the last column then paint that in the window but.
It just doesnt work.
I would appreciate some help. Thanks.
this loop will kill you :P
.while var1 < 768 ;<< Bitmap width
invoke BitBlt,memDCBack,0,0,767,576,memDC,1,0,SRCCOPY ;take from pixel 1 to width
invoke BitBlt,memDCBack,767,0,1,576,memDC,767,0,SRCCOPY ;take pixel 1 to last column
invoke BitBlt,hDC,10,10,768,576,memDCBack,var1,0,SRCCOPY ;draw the image
inc var1
.endw
i would think you can do it with 3 BitBlt's and no loop - if the "split" offset is 0, only 2
all you have to have as a variable is the x-offset of the "split" - which could change with a timer or something
remember those old beer signs ??? :bg
It's Miller Time ! (http://dedndave.x10hosting.com/MillerTime.zip)
what ?
no one likes my beer sign :red
maybe a pic would help...
(http://i1154.photobucket.com/albums/p527/DednDave/pic.png)
lol very nice dave! :clap: I like it :bg
Quote from: dedndave on May 24, 2012, 04:49:18 AM
what ?
no one likes my beer sign :red
maybe a pic would help...
(http://i1154.photobucket.com/albums/p527/DednDave/pic.png)
Thats pretty neat Dave. I do Flash banners for websites that have scrolling backgrounds like that (usually the sky) but this is the first time I've seen an ad banner done in asm.
How come you guys are still posting in the old forum? You should post your example over in the new forum. The only reason I found your example is I accidentally clicked on the old Masm32 link.
yah - the guy is a newbie
if i moved to the other forum, he might not find it :P
anyways - it is on an external host
the miller beer signs came to mind when he mentioned "cylinder" scrolling
hamm's beer used to have some, too
i wish i could get a look at some of the old ones
they worked by having areas in the front with holes in it
then - the water and/or beer looked like it flowed from the scrolling back
we could do a player piano, too :bg
my mom probably has about 100 scrolls of music
we could have a keyboard with keys moving up and down - lol
of course - we give them the program for free - then sell them the music scroll files :bdg
Thank's I've moved to the new Forum.
could you please continue helping? I didn't undestand about the offset.
Yes i'm a newbie.