Thread View: borland.public.cppbuilder.internet.web
5 messages
5 total messages
Started by Anton
Fri, 14 Mar 2008 11:35
capture maps
Author: Anton
Date: Fri, 14 Mar 2008 11:35
Date: Fri, 14 Mar 2008 11:35
14 lines
1127 bytes
1127 bytes
Hello, Using TCppWebBrowser I made an application to show Google Maps or Microsoft Virtual Earth. Now I'm looking for a way to capture those maps in a jpeg. I wonder if someone has an idea to do this. Thanks, regards Anton
Re: capture maps
Author: Brian
Date: Mon, 31 Mar 2008 18:13
Date: Mon, 31 Mar 2008 18:13
40 lines
2454 bytes
2454 bytes
> Using TCppWebBrowser I made an application to show Google Maps or
> Microsoft Virtual Earth.
>
> Now I'm looking for a way to capture those maps in a jpeg.
>
I did this a while ago (if I remember correctly, I owe Remy a credit or two):
TComInterface<IHTMLDocument2> Doc;
TComInterface<IHTMLStyle> Style;
TComInterface<IHTMLElement> Body;
TComInterface<IHTMLBodyElement> BodyElement;
TComInterface<IViewObject> ViewObject;
{ if(SUCCEEDED(web->Document->QueryInterface(IID_IHTMLDocument2,(LPVOID*)&Doc)))
{ if(SUCCEEDED(Doc->get_body(&Body)))
{ if(SUCCEEDED(Body->QueryInterface(IID_IHTMLBodyElement,(LPVOID*)&BodyElement)))
{ BodyElement->put_noWrap(VARIANT_TRUE);
// hide scrollbars
if( SUCCEEDED(Body->get_style(&Style)))
Style->put_borderStyle(WideString("none"));
BodyElement->put_scroll(WideString("no"));
web->Document->QueryInterface(IID_IViewObject,(LPVOID*)&ViewObject);
if(ViewObject)
{ RECT SourceRect=Rect(0,0,web->Width,web->Height);
Graphics::TBitmap *bitmap=new Graphics::TBitmap;
bitmap->PixelFormat=pf32bit;
bitmap->Height=web->Height;
bitmap->Width=web->Width;
if(SUCCEEDED(ViewObject->Draw(
DVASPECT_CONTENT,1,NULL,NULL,
this->Handle,bitmap->Canvas->Handle,
(_RECTL *) &SourceRect, NULL, NULL,0)))
{ ...
delete bitmap;
}
}
}
}
}
}
Re: capture maps
Author: Anton
Date: Tue, 01 Apr 2008 19:23
Date: Tue, 01 Apr 2008 19:23
63 lines
2863 bytes
2863 bytes
Thank you very much for your answer.
Maybe I will try it, but by accident I found an easier way to download the
images.
Nevertheless thanks again.
regards,
Anton
"Brian" <brian@nospam.net> schreef in bericht
news:2f97fdd08a398ca61482f0b0c0e@newsgroups.borland.com...
>> Using TCppWebBrowser I made an application to show Google Maps or
>> Microsoft Virtual Earth.
>>
>> Now I'm looking for a way to capture those maps in a jpeg.
>>
> I did this a while ago (if I remember correctly, I owe Remy a credit or
> two):
>
> TComInterface<IHTMLDocument2> Doc;
> TComInterface<IHTMLStyle> Style;
> TComInterface<IHTMLElement> Body;
> TComInterface<IHTMLBodyElement> BodyElement;
> TComInterface<IViewObject> ViewObject;
>
> {
> if(SUCCEEDED(web->Document->QueryInterface(IID_IHTMLDocument2,(LPVOID*)&Doc)))
> { if(SUCCEEDED(Doc->get_body(&Body)))
> {
> if(SUCCEEDED(Body->QueryInterface(IID_IHTMLBodyElement,(LPVOID*)&BodyElement)))
> { BodyElement->put_noWrap(VARIANT_TRUE);
> // hide scrollbars
> if( SUCCEEDED(Body->get_style(&Style)))
> Style->put_borderStyle(WideString("none"));
> BodyElement->put_scroll(WideString("no"));
>
> web->Document->QueryInterface(IID_IViewObject,(LPVOID*)&ViewObject);
> if(ViewObject)
> { RECT SourceRect=Rect(0,0,web->Width,web->Height);
> Graphics::TBitmap *bitmap=new Graphics::TBitmap;
> bitmap->PixelFormat=pf32bit;
> bitmap->Height=web->Height;
> bitmap->Width=web->Width;
> if(SUCCEEDED(ViewObject->Draw(
> DVASPECT_CONTENT,1,NULL,NULL,
> this->Handle,bitmap->Canvas->Handle,
> (_RECTL *) &SourceRect, NULL, NULL,0)))
> { ...
> delete bitmap;
> }
> }
> }
> }
> }
> }
>
>
Re: capture maps
Author: Daryl
Date: Wed, 02 Apr 2008 08:01
Date: Wed, 02 Apr 2008 08:01
9 lines
1362 bytes
1362 bytes
> Maybe I will try it, but by accident I found an easier way to download the > images. Anton I would be interested in how you did this - could you please explain and perhaps share the code used to do this? thanks daryl
Re: capture maps
Author: Anton
Date: Thu, 03 Jul 2008 20:05
Date: Thu, 03 Jul 2008 20:05
50 lines
2282 bytes
2282 bytes
Hi Daryl, At first I have to say I feel very sorry that I did not see your question earlier. Nevertheless here is the answer, maybe you don't need it anymore, but in that case just forget it. In fact this solution has not much to do with C++. In the first place you need the VirtualEarth Tile Name generator:http://www.gnewt.org/timoney/vetileinfo.php This php-application generates the name of the picture by inputting the lat & lon coordinates. if you put 0,50,4,51,10 for min lon, min lat, max lon, max lat and zoomlevel 10 you will receive several names. Then you can put the name in the next sentence and you get the picture http://t0.tiles.virtualearth.net/tiles/h0313131331.pg?g=117 the h stands for hybrid I think. I suppose there are more combinations available, but this is what I found out. Regards Anton "Daryl" <devaccount@hotmail.com> schreef in bericht news:47f33d62@newsgroups.borland.com... >> Maybe I will try it, but by accident I found an easier way to download >> the images. > > Anton > I would be interested in how you did this - could you please explain and > perhaps share the code used to do this? > > thanks > daryl >
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads