How do I extract an image in an img element on a webcontrol website?

I would like to extract a bitmap from an html page. I was expecting to find IStream, IPersistStream or IPersistStreamInit from the IHTMLImgElement I got in the webpage. However, I cannot find them.

I could read the image from the cache, but that is somewhat unreliable and I would like not to read from the filesystem.

Is there any interface I could use to get the bitmap?

0


source to share


1 answer


Use IHTMLElementRender.

By using QueryInterface in your IHTMLImgElement, you can get a pointer to the IHTMLElementRender interface and then call DrawToDC in the memory DC.

There are several ways to save a bitmap while it is in DC memory.



...

I actually found a sample, just g ** gle 'IHTMLElementRender IHTMLImgElement "GDI +".

+1


source







All Articles