Re: Get images with MSHTML library in Visual Basic 6.0
- From: "Mike D Sutton" <EDais@xxxxxxxx>
- Date: Wed, 13 Jul 2005 20:30:43 +0100
> 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/
.
- Follow-Ups:
- References:
- Prev by Date: VBScript: Dictionary object not creating anymore
- Next by Date: Re: Empty Array
- Previous by thread: Get images with MSHTML library in Visual Basic 6.0
- Next by thread: Re: Get images with MSHTML library in Visual Basic 6.0
- Index(es):
Relevant Pages
|