Re: Get images with MSHTML library in Visual Basic 6.0
- From: Hnd@.
- Date: Wed, 13 Jul 2005 19:15:27 -0500
On Wed, 13 Jul 2005 20:30:43 +0100, "Mike D Sutton" <EDais@xxxxxxxx>
wrote:
look below...
>> 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/
>
Thanks.
As an even better time saver, I could add the internet shdocvw.dll
class to a form and then use it's methods to navigate to the binary
resource. The control on the VB form will put the binary into the
cache defined by the pre-existing control by the installation of
windows.
Can I change the form.[internetControl].[properties] while it is
running to cache the images to another directory?
.
- Follow-Ups:
- Re: Get images with MSHTML library in Visual Basic 6.0
- From: Mike D Sutton
- Re: Get images with MSHTML library in Visual Basic 6.0
- References:
- Get images with MSHTML library in Visual Basic 6.0
- From: Hnd
- Re: Get images with MSHTML library in Visual Basic 6.0
- From: Mike D Sutton
- Get images with MSHTML library in Visual Basic 6.0
- Prev by Date: Re: looking for installation/setup program examples
- Next by Date: Re: IF/THEN Structure Issues - "Error: Too Many Continuations" PLS Hel
- Previous by thread: Re: 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
|