Solved

Get image from webbrowser to Picturebox?

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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Problem to skip loop 6 56
Paint/Redraw window while dragging 16 75
Excel VBA, find a string in a column, update a cell 7 74
VB6 ListBox Question 4 42
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…
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 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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

815 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

13 Experts available now in Live!

Get 1:1 Help Now