Results 1 to 8 of 8

Thread: Graphics

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2002
    Posts
    12

    Graphics

    I'm making a program that has quit a bit of graphics in it. Whenever I switch pictures or move them they flicker. Seems like a redraw problem. Does anyone know what I can do to help this?

    Thanks.

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    Whenever you do these, try putting in

    VB Code:
    1. DoEvents

    in there.

  3. #3
    New Member
    Join Date
    Jun 2002
    Posts
    13
    i have not tried much in vb but in qbasic we just drew the pictures in a different screen and did pcopy() to copy that page to the visible one..

    some one yell at me know lol

  4. #4
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    *clears throat*

    THERE'S NO PCOPY IN VB!!!


  5. #5

    Thread Starter
    New Member
    Join Date
    Apr 2002
    Posts
    12
    I just put doevents at the top of the procedure right? If so, it doesn't really work. what does Doevents do? I forgot. I thought it had something to do with threads. Well thanks anyway.

  6. #6
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    More or less, yeah.
    While your app is running, it's taking up most of the CPU time. Now when u switch pics or reposition, the form must be redrawn. That's where the DoEvents comes in, telling the CPU to finish up on (other) work which includes redrawing the form.

    Put DoEvents in between your code, for example when u move your pic, etc.

  7. #7
    Hyperactive Member
    Join Date
    Oct 2001
    Location
    The Netherlands
    Posts
    403
    Check the Api LockWindowUpdate.
    There are 10 types of people, those who understand binary and those who don't

    http://merlijn.beyonix.net

  8. #8

    Thread Starter
    New Member
    Join Date
    Apr 2002
    Posts
    12
    To Xa0z:
    From what I found all LockWindowUpdate does is enable or disable drawing in a window. But I was looking at the redrawWindow API that looks like it might be helpful. Any thoughts on that API call?

    To mendhak:

    Private Sub Timer1_Timer()
    DoEvents
    image1.Left = image1.Left + 100
    End Sub

    Is that what you mean?
    (How'd you get your code sectioned off?)

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