It is necessary to save the image from the page opened in Webbrowser, I found the following solution:
var body, imgs, controlRange: olevariant; begin body := wb1.OleObject.document.body; imgs := wb1.OleObject.document.images.item(i);//нужный img controlRange := body.createControlRange; controlRange.add(imgs); controlRange.execCommand('Copy', False, EmptyParam);//копируем if ClipBoard.HasFormat(CF_BITMAP) then begin img1.Picture.Bitmap.LoadFromClipboardFormat(cf_BitMap, ClipBoard.GetAsHandle(cf_Bitmap), 0);//вставляем Clipboard.Clear;// очищаем буфер end; end; on line
controlRange.add(imgs); gives:
"Method 'add' not supported by automation object"
How to make this code work? OS Windows 7, IE 11.
Can someone tell me another solution, how to save the picture?