How to get image from IHTMLImgElement ?
-
Hello! There is interface IWebBrowser2, which I use to get IHTMLDocument2, IHTMLElementCollection, IHTMLElement, IHTMLImgElement from. I can get different picture options from IHTMLImgElement, but I can't get the picture itself. How can I do that? Please advise. P.S. I've tried to use the following code:
IOleCommandTarget* pCT;
CComVariant vGlyphTableEntry;
vGlyphTableEntry = "c:\\temp.jpg";if (pElemDispatch->QueryInterface(__uuidof(IOleCommandTarget), (void**)&pCT)==S_OK)
{
pCT->Exec(&CGID_MSHTML, IDM_SAVEPICTURE , OLECMDEXECOPT_DONTPROMPTUSER ,&vGlyphTableEntry, 0);
pCT->Release();
}But this code shows the 'Save as' dialog, which shouldn't appear. What's wrong with this code? Is there some other way to do that? Thanks in advance
-
Hello! There is interface IWebBrowser2, which I use to get IHTMLDocument2, IHTMLElementCollection, IHTMLElement, IHTMLImgElement from. I can get different picture options from IHTMLImgElement, but I can't get the picture itself. How can I do that? Please advise. P.S. I've tried to use the following code:
IOleCommandTarget* pCT;
CComVariant vGlyphTableEntry;
vGlyphTableEntry = "c:\\temp.jpg";if (pElemDispatch->QueryInterface(__uuidof(IOleCommandTarget), (void**)&pCT)==S_OK)
{
pCT->Exec(&CGID_MSHTML, IDM_SAVEPICTURE , OLECMDEXECOPT_DONTPROMPTUSER ,&vGlyphTableEntry, 0);
pCT->Release();
}But this code shows the 'Save as' dialog, which shouldn't appear. What's wrong with this code? Is there some other way to do that? Thanks in advance