Home > Back-end >  Questions about Delphi show web images (DomImg2Image) : Invalid Clipborad Format.
Questions about Delphi show web images (DomImg2Image) : Invalid Clipborad Format.

Time:09-24

Searched a piece of code on the net, computer can be used in the office, home computer will display the following error: Invalid Clipborad Format. The net some friends like me, but no one ever said the solution, please master to help solve, thank you!
Code:

Procedure DomImg2Image (id: string; Wb: TWebBrowser; Img: TImage);
Var
Reaching: IHTMLControlRange;
The begin
Reaching:=((IHTMLDocument2 (wb) Document). The body as HTMLBody). CreateControlRange) as
IHTMLControlRange;
Reaching. The add (IHTMLDocument2 (wb) Document.) images. The item (id, EmptyParam) as
IHTMLControlElement);
Reaching the execCommand (' Copy ', False, 0);
Img. Picture. Assign (ClipBoard);
end;
The following two pages are discussed, but no results, I'd like to know what this is why???????
http://www.myexception.cn/delphi/226895.html
http://bbs.csdn.net/topics/390347997

CodePudding user response:

Top by oneself, hope the great god for help

CodePudding user response:

Alternatively can do, not necessarily using the clipboard, you can find pictures link, pictures can also directly download

CodePudding user response:

refer to the second floor wuweifenfang response:
alternatively can do, not necessarily using the clipboard, you can find pictures link, pictures can also directly download

I just want to know the reason

CodePudding user response:

Procedure Tfload. FormCreate (Sender: TObject);
The begin
OleInitialize (nil);
end;

Procedure Tfload. FormDestroy (Sender: TObject);
The begin
OleUninitialize;
end;

Less added these two things
  • Related