Solved

Get image from webbrowser to Picturebox?

Posted on 2004-09-25
2
1,050 Views
Last Modified: 2008-01-09
I need to get an image from a webbrowser control to a picture box.. anyone know a good way to do this?
0
Comment
Question by:esdfesdf
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 11

Accepted Solution

by:
bingie earned 200 total points
ID: 12153111
You will have to download the picture first. Add a picture box and paste the following then run.

Private Declare Function URLDownloadToFile Lib "urlmon" Alias _
        "URLDownloadToFileA" (ByVal pCaller As Long, ByVal szURL As String, ByVal _
                szFileName As String, ByVal dwReserved As Long, ByVal lpfnCB As Long) As Long

Private Sub Form_Load()
szURL = "http://www.experts-exchange.com/images/certification.gif"
szFileName = "C:\ee.jpg"
Call URLDownloadToFile(0&, szURL, szFileName, 0, 0)
DoEvents
Picture1.Picture = LoadPicture("C:\ee.jpg")
End Sub
0
 
LVL 76

Expert Comment

by:David Lee
ID: 12155276
Another approach is to copy the image to the clipboard and then paste the clipboard into the picturebox.  If you always want to paste the image into a single picturebox, then you could add a button to your app that'd handle the pasting.  This would only require a single line of code.

    Picture1.Picture = Clipboard.GetData()

If you have multiple pictureboxes, then build a context menu so you can right-click on the picturebox you want to paste the image into and select paste.
0

Featured Post

Technology Partners: 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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
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…
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…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

730 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