Solved

Viewiing web images

Posted on 2001-06-13
4
139 Views
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...

i.e.

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.
0
Comment
Question by:perkster
  • 2
4 Comments
 
LVL 28

Accepted Solution

by:
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 = "http://www.experts-exchange.com/images/topleft.gif"
  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

Cheers
0
 
LVL 8

Expert Comment

by:glass_cookie
ID: 6189446
Use a webbrowser control to view it.

InVB,
Components... > Microsoft Internet Controls > OK.

Then, to load the pictur, add this line:

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

That's it!

glass cookie : )
0
 

Author Comment

by:perkster
ID: 6192109
Ark,

  I am getting a runtime error on:

Inet1.Protocol = icHTTP

What component needs to be loaded to make this work?

Perkster
0
 
LVL 28

Expert Comment

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

Cheers
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

749 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