Solved

Viewiing web images

Posted on 2001-06-13
4
136 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 27

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 27

Expert Comment

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

Cheers
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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…
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…

911 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

27 Experts available now in Live!

Get 1:1 Help Now