Results 1 to 3 of 3

Thread: Moving image

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Nov 2000
    Location
    USA
    Posts
    28

    Moving image

    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.
    The best poster in the world is a window.

  2. #2
    Frenzied Member ae_jester's Avatar
    Join Date
    Jun 2001
    Location
    Kitchener Ontario Canada Earth
    Posts
    1,545
    So uh....whats your question?

  3. #3
    Fanatic Member Mushroom Realm's Avatar
    Join Date
    Mar 2002
    Location
    Murrieta, California
    Posts
    650
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width