Article View: borland.public.cppbuilder.internet.web
Article #41Re: capture maps
From: 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;
> }
> }
> }
> }
> }
> }
>
>
Technical Details
Message-ID:
<47f28bbf$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<47da62f1$1@newsgroups.borland.com> <2f97fdd08a398ca61482f0b0c0e@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: feeec,13b4c6a9d6acfeb7 X-Google-Attributes: gidfeeec,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit From: "Anton" <acvoosten@zeelandnet.nl> Newsgroups: borland.public.cppbuilder.internet.web References: <47da62f1$1@newsgroups.borland.com> <2f97fdd08a398ca61482f0b0c0e@newsgroups.borland.com> Subject: Re: capture maps Date: Tue, 1 Apr 2008 21:23:31 +0200 Lines: 65 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.3138 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198 X-RFC2646: Format=Flowed; Response NNTP-Posting-Host: 86.87.46.231 Message-ID: <47f28bbf$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1207077823 86.87.46.231 (1 Apr 2008 12:23:43 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail