Solved

Get image from webbrowser to Picturebox?

Posted on 2004-09-25
2
1,055 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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

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…
Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
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…
Suggested Courses
Course of the Month7 days, 1 hour left to enroll

623 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