Results 1 to 4 of 4

Thread: When is the picture loaded?

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2000
    Posts
    10
    Hi.

    Does anybody know how to find out when a picture is loaded? (without looking)

    I have this:

    With Start
    .Visible = False
    .Stretch = False
    .Picture = LoadPicture(lp)
    End With

    But I need to know when the picture is finished loading, and... but this is not important.. somehow wait until the task is finished before doing something else. Any Ideas?

    Thanks

    martin

  2. #2
    Guest
    A DoEvents might do the trick.

    Code:
    With Start 
    .Visible = False 
    .Stretch = False 
    .Picture = LoadPicture(lp) 
    DoEvents
    Msgbox "Picture done"
    End With

  3. #3
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    The picture property returns a handle when it's loaded with a stdpicture so you check for the handle
    Code:
    do until .picture
    doevents
    loop
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  4. #4

    Thread Starter
    New Member
    Join Date
    Aug 2000
    Posts
    10
    Thanks. I tried the:

    DoEvents
    Msgbox "Picture done"
    End With

    before I posted anything here, and that worked fine... until it had to load two pictures.. like this:

    frmPage.Picture1.Picture = LoadPicture("d:/cata/blue.bmp")frmPage.Picture2.Picture = LoadPicture("d:/cata/red.bmp")frmPage.Picture3.Picture = LoadPicture("d:/cata/green.bmp")
    DoEvents
    Msgbox "Picture done"

    then for some reason it continued the execution of the rest of the code before all the pictures was loaded.

    the

    do until .picture
    doevents
    loop

    works fine...

    thanks


    martin

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