Hi,
My prog takes a location the user inputs and searches for a map of that location through a webbrowser. I need to be able to take the image from the webbrowser and show it in a picturebox on my form. The name of the picture will always remain constant but the location is always different. The page where I submit the location the user input is sent is here . Type in 'Sandton' into that first textbox and the map which comes up is the image which I would like to get with my webbrowser into a picturebox.
Thanx a lot,
If I helped you out, please consider adding to my reputation!
-- "The faulty interface lies between the chair and the keyboard" --
I already looked at that RobDog888, but I couldnt find out how to take the images with a webbrowser and move them to a Picturebox.
I expect it will be using the MS HTML Object Library, and then something like
I think you would have to use the Inet control then to download the page and parse out the "<img" or "src=" tags. Then use the Open filename to put the binary picture in a local file and load to a picturebox. This is how I did it before.
That code will download the html as a string (icString)
You will have to parse the filename from the data that is returned, and then download that file (sSrc)
icString is a constant that defines the Inet control to open the page as string text. sScr is a variable to hold the parsed image location.
You could set your browser to navigate to "http://www.maporama.com/affiliates/shellza/share/map.asp?SEARCH_ADDRESS.x=0&COUNTRYCODE=ZA&SESSIONID=6C164693-6C0F-48B5-B3FA-E0FF20B64397&_XgoGCTownName=Sandton&Zip=&_XgoGCAddress=&x=15&y=20" and when the page is completely loaded you can search for the image name/location and then use the Inet control to open that location as Binary and download the image to the temp file and use LoadImage into the picturebox.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
OK thanx guys!
Now how do I go about parsing the location of that image because it doesnt end in a regular .jpg or .gif extension.
I really appreciate any help,
If I helped you out, please consider adding to my reputation!
-- "The faulty interface lies between the chair and the keyboard" --
I dont think your going to be able to do this as the page is an ASP page and the image is rendered only if you have a current valid session variable id initiatedfrom the initial page. Its probably for preventing people from using its images
This is the location of the map picture and as you can see it has the session variable and other parameters passed to create the image map.
What you can do is use the inet control set to the initial page and populate the city name and submit. Then in the resulting page parse out the session id and save to a variable. Then connect using the inet control again to the image location passing the session id and image parameters. Then Put it to a system file and load to your picturebox control. Not very pretty but it may work.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
XgoUserID=1F2A8BEBF4148E4 is the session parameter value that will change between runs.
Not too sure what this one is for: XgoNbReq=3
This is the image extension: XgoAnswer=Gif
Image properties: sizex=370&sizey=263&
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
That's the Active Server Page on the webserver. You cannot access it directly, without passing it the other information. You could have your program fill out the first page and click the button though.