Results 1 to 2 of 2

Thread: Problem with LoadImage from http ?

  1. #1

    Thread Starter
    Addicted Member Tengkorak's Avatar
    Join Date
    Nov 2006
    Posts
    240

    Problem with LoadImage from http ?

    i have image in my host :

    http://www.myhost.com/image/data/092/92-1001.jpg

    this url can work when i put at Image design.
    but not work when called in code :

    Code:
    img = http://www.myhost.com/image/data/092/92-1001.jpg
        Set Image1.Picture = LoadPicture(img)
    i get error
    Path/File access error: 'http://www.myhost.com/image/data/092/92-1001.jpg'
    how to fix this problem ?

    thanks

  2. #2
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: Problem with LoadImage from http ?

    The LoadPicure method accepts hard drive paths only, not URLs

    At least 3 ways this can be done:

    1. Add a usercontrol to your project and use its download ability via the AsyncRead method. Search forum for examples via key word: AsyncRead

    2. Download the image to a file, then use LoadPicture. Example here

    3. Download the file straight to the Image control without using LoadPicture. Example here
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

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