Re: Get images with MSHTML library in Visual Basic 6.0



> Hello, Look through this snippet for my question...
> Thanks. Does anyone have any suggestions?
<code snipped>
> What do I put here to get the binary data returned from the image tag
> contained in the doc object?
>
> When using the .navigate method with the InternetExplorer object, does
> it return actual binary content that I can access and store on the
> hard drive? Or, does it just return the html document "text" without
> returning any "byte arrays" which would be image data?
>
> MUST I use the stream object and the msxml object to do this?
>
> It seems I should be able to .navigate to some binary resource URL and
> then get the binary data from the HTMLDocument object.
>
> Is there another class in the (\WINNT\system32\MSHTML.TLB) MSHTML
> library I'm missing which would easily do this?

I don't know of any way to do this through the object model, but the HTMLImg object has an href property which specifies
the URI to the image, you can then use the Internet*() API calls to go and grab that file. Since both objects use the
same internet cache, if web browser has already downloaded the file then this will simply pull back the local copy of
the file.
To grab the file use the InternetOpen(), InternetOpenUrl(), InternetReadFile() and InternetCloseHandle() API calls.
Hope this helps,

Mike


- Microsoft Visual Basic MVP -
E-Mail: EDais@xxxxxxxx
WWW: Http://EDais.mvps.org/


.



Relevant Pages

  • Re: connection to server via HTTP & GET/POST method in vc++
    ... This is my first application on socket programming in vc++. ... Download the "wininet" API (or other equivalent Microsoft ... Microsoft's particular API implementation of Internet protocols) ...
    (comp.lang.c)
  • Re: Adding an item to R-Click context menu
    ... There used to be a way to hand code some Windows ... And if there is that API, ... to be a similar API for the mouse right clicks in Internet ... Explorer, or is it the Explorer API? ...
    (microsoft.public.vb.general.discussion)
  • Re: "Four" to 4
    ... This has been done countless times in the last few decads and you should be ... able to find examples on the Internet. ... Fergus Cooney (whatever happened to him Cor?) and me along with a few ... completed set of functions near the end of the thread so you shouldn't grab ...
    (microsoft.public.dotnet.languages.vb)
  • Links and file times
    ... If I traverse a path using FindFirstFile/FindNextFile: ... Is there an API to identify which files are links, ...
    (microsoft.public.vb.winapi)
  • Re: How to add IE security zones by VB apps?
    ... > The Internet Explorer offers only 4 zones like Internet, Local Internet, ... Is there an API which allows to add and define user defined ... I think there is a documented API and if there is ...
    (microsoft.public.vb.winapi)