Viewiing web images

Posted on 2001-06-13
Last Modified: 2010-05-02
I have an area in my application for viewing images (image1.)

I would like to be able to view the image of a specified web address...


image1.picture = Load Picture(www.??????/target.jpg)

How do I set this up to use the address as the source for the pic and display it in my vb program?  Help.
Question by:perkster
  • 2
LVL 27

Accepted Solution

Ark earned 100 total points
ID: 6189410
Add Internet Transfer Control (Inet1)

Private Sub Command1_Click()
  Dim b() As Byte
  Dim sURL As String
  sURL = ""
  Inet1.Protocol = icHTTP
  b = Inet1.OpenURL(sURL, icByteArray)
  Open "c:\temp.gif" For Binary As #1
  Put #1, , b
  Close #1
  Image1.Picture = LoadPicture("c:\temp.gif")
  Kill "c:\temp.gif"
End Sub


Expert Comment

ID: 6189446
Use a webbrowser control to view it.

Components... > Microsoft Internet Controls > OK.

Then, to load the pictur, add this line:

Webbrowser1.Navigate "www.??????/target.jpg"

That's it!

glass cookie : )

Author Comment

ID: 6192109

  I am getting a runtime error on:

Inet1.Protocol = icHTTP

What component needs to be loaded to make this work?

LVL 27

Expert Comment

ID: 6193541
VB menu -> Project -> Components -> Microsoft Internet transfer control (msinet.ocx)


Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now