Results 1 to 2 of 2

Thread: Imagebox flickers too much.

  1. #1

    Thread Starter
    Member
    Join Date
    Aug 2000
    Posts
    39

    Question

    I have inherited a useless project to revamp. Its main functionality (of which there is little) involves having 4 image boxes sitting on top of each other, with transparent gifs being displayed in them, giving the effect when you change something on a combo box that it changes whichever of the transparent gifs that combo box relates to.

    Its kind of a preview program for viewing what certain home layouts look like, crap really, but I have to tidy it up and the worst part of it is the flicker as it loads in the next image. The code to change the contents of the image box goes like this :

    if combobox1.text ="whatever" then
    image1.picture = loadpicture("whatever.gif")
    end if

    the form autoredraw is set to false.

    Any idea why it flickers like mad ?

  2. #2
    Frenzied Member
    Join Date
    Mar 2000
    Posts
    1,089
    The reason why it flickers is because when you set the picture property of the image box it first clears the old picture and then sets the new one, so there is a fraction of a second where there is nothing there.

    Your best bet is to create a memory DC the same size as your form and use paintpicture to put the images onto the offscreen DC and then when it's ready bitblt it onto the form.

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