PDA

Click to See Complete Forum and Search --> : Moving image


phreeze
Aug 1st, 2002, 12:43 AM
I'm haveing a slight problem with bitblt. I have a form and a picturebox. The form is to be drawn upon and the picturebox is just for temporary storage. I put a Timer on the form and set it every second to update and copy the content of the form into the picturebox then put it back on the form to the left of one pixel. Like a moving chart. Like the task manager CPU chart. See what i'm saying? Hope I explained good enough. Thank you.

ae_jester
Aug 1st, 2002, 12:43 PM
So uh....whats your question?

Mushroom Realm
Aug 2nd, 2002, 08:16 PM
Instead of bitblt u could use getpixel, setpixel. Make sure u call them in the variable section. Then do this:

Dim Color as Long
Dim X as Long
Dim Y as Long

For X = 0 to Form1.scalewidth
For Y = 0 to Form1.scaleheight
Color = GetPixel(form1.hdc,x,y)
setpixel picture1.hdc ,X ,Y ,Color
Next Y
Next X

For X = 0 to picture1.scalewidth
For Y = 0 to picture1.scaleheight
Color = GetPixel(picture1.hdc,x,y)
setpixel form1.hdc ,X-1 ,Y-1 ,Color
Next Y
Next X

form1 = the forms name
picture1 = the picturebox's name

that should do the trick