Re: Printing map from web page
- From: "Saga" <antiSpam@xxxxxxxxxxxxx>
- Date: Mon, 15 May 2006 16:12:09 -0500
Here is how I did it:
I loaded the page into a web browser object.
I located the image, the HTML looks like this:
<img src="http://maps.google.com/mapdata?Point=b&
Point.latitude_e6=41852681&Point.longitude_e6=4207123396&
Point.iconid=15&Point=e&latitude_e6=41852681&
longitude_e6=4207123396&zm=4800&w=600&h=400&cc=US&
min_priority=1"
border=1
width="600"
height="400">
I took the value of src and fed it into the DownloadFile API and
it downloaded a GIF file. I then reload the image file into an image
control and process it from there.
Regards
Saga
"Saga" <antiSPAM@xxxxxxxxxxx> wrote in message
news:unqamX9dGHA.3888@xxxxxxxxxxxxxxxxxxxxxxx
Hi all,
I am in need of printing out a map from a web page. The map can be
from
mapquest, yahoo maps or google maps. My app is using the web browser
control. I navigate to the corect page and can see the map onscreen,
but I
can't get he image into my app to print it out.
I used Veign's GetStuff app to analyze the contents of the page and
discovered that the image is not a typical gif or jpg. Rather, the
"image"
is in reality a call to the Map API to generate the image.
Interestingly
enough, I can right click on the image and save it as a file.
For Google maps, I am using the output=html parameter in the URL to
generate an HTML page, rather than the default interactive one that is
displayed if this parameter is not given.
I found an example on the 'net to Print the Contents of a Web Page,
but this essentially was a screen capture that was "saved" in a
picture
object, then sent to the printer using this command:
printer.Paintpicture picX ...etc
I played around with it and got it to work, but its correct behavior
depends on a number of factors, such as not resizing the dialog and
keeping the dialog as the top window, both of which I can't garantee.
Ideally, I need to bring the image into my app and combine it with
other
data in the printed report. This might be possible by sending the
right
commands to IE to save the graphics file as a gif, then having my app
read the gif back in. I am using VB6+SP5. Any suggestions on how to
get the map image into my app are welcomed. Thanks for your time
and assistance :-)
Regards
Saga
.
- References:
- Printing map from web page
- From: Saga
- Printing map from web page
- Prev by Date: Re: Reading and displaying contents of a file
- Next by Date: Command Line Arguments
- Previous by thread: Re: Printing map from web page
- Next by thread: Re: Limitation of Code lines in Class File (VB6)
- Index(es):
Relevant Pages
|