Results 1 to 13 of 13

Thread: Please help me stop flickering!

  1. #1
    j2k
    Guest

    Please help me stop flickering!

    Hi,

    I have four imageboxes which update every second. The only problem is, after about three or four updates, the images flicker. Then it will be okay for three or four more, then it will flicker again..

    This becomes rather annoying after a prolonged period of time.

    Please help!

    TIA!

  2. #2
    Frenzied Member numtel's Avatar
    Join Date
    Apr 2000
    Location
    CA
    Posts
    1,163
    Are you using BitBlt, PaintPicture or just setting the control's property?

  3. #3
    PowerPoster
    Join Date
    Jul 1999
    Posts
    5,923

  4. #4
    j2k
    Guest
    Chrisjk - I tried that, the flickering is still there though

    numtel - I use img1.Picture=LoadPicture (pathtopicture)

  5. #5
    j2k
    Guest
    Would BitBlt or PaintPicture stop the flickering?

  6. #6
    Addicted Member Jez1's Avatar
    Join Date
    Oct 2001
    Location
    Warwickshire, England
    Posts
    185

    Flickering

    If U can, change the image box to a picture box - they don't seem to flicker.

  7. #7
    Fanatic Member BrianHawley's Avatar
    Join Date
    Aug 2001
    Location
    Saudi Arabia
    Posts
    796
    You could use two image/picture boxes instead of one.

    Do your updates on the back one, then bring it to the front.

    That's an old trick for slow (i.e. calculated) drawing operations that you want to seem to appear quickly.
    Brian
    (Fighting with the RightToLeft bugs in VS 2005)

  8. #8
    PowerPoster eiSecure's Avatar
    Join Date
    Jul 2000
    Location
    Texas
    Posts
    2,209
    You could always use an off-screen buffer with BitBlt. That would probably stop the flickering...

  9. #9
    Frenzied Member
    Join Date
    Aug 2001
    Posts
    1,075
    When you use LoadPicture() you are reading the file from the harddisk when you load it. Very slow as far as displaying an image goes. If there are not too many images I would use and array of image controls or even an ImageList control. Have all of your images loaded and then just swap them into the one visible image control as needed.

    Greg
    Free VB Add-In - The Reference Librarian
    Click Here for screen shot and download link.

  10. #10
    PowerPoster eiSecure's Avatar
    Join Date
    Jul 2000
    Location
    Texas
    Posts
    2,209
    ...or you can make it into an animated GIF or an AVI file, and then just play it. ....if it's possible.

  11. #11
    PowerPoster
    Join Date
    Aug 2000
    Location
    IN SILENCE
    Posts
    6,441

    Well

    Declare Function LockWindowUpdate Lib "user32" _
    (ByVal hWnd As Long) As Long

    This doesn't work? Where in your code are you placing?
    Remaining quiet down here !!!

    BRAD HAS GIVEN ME THE ULTIMATIVE. I have chosen to stay....

  12. #12
    j2k
    Guest
    How would I use an ImageList, ie what code? I have added all the pictures, but how do I make a picturebox display a picture in the imagelist?

  13. #13
    PowerPoster
    Join Date
    Aug 2000
    Location
    IN SILENCE
    Posts
    6,441

    Well

    Set Picure1.picture=me.Image1.Imagelist(1).Picture
    Remaining quiet down here !!!

    BRAD HAS GIVEN ME THE ULTIMATIVE. I have chosen to stay....

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