[Delphi]View PlainCopyprint?
- Uses
- Activex,comobj;
- Procedure Tfrmmain. Formcreate (Sender:tobject);
- Begin
- OleInitialize (nil);
- End
- Procedure Tfrmmain. Domimg2image (Wb:twebbrowser);
- Var
- I:integer;
- Rang:ihtmlcontrolrange;
- S:string;
- Begin
- Try
- //pic is the name of the node (layer) of the picture, you open the source code and look, replace it with yours .
- S: = (IHTMLDocument2 (WB). Document). Images.item (' pic ', Emptyparam) as IHTMLElement). getattribute (' src ',0);
- //showmessage (s);
- rang:= (IHTMLDocument2 (WB. Document). Body as HTMLBody). createControlRange) as
- Ihtmlcontrolrange;
- Rang. Add (IHTMLDocument2 (WB). Document). Images. Item (' pic ', Emptyparam) as
- IHTMLControlElement);
- Rang. ExecCommand (' Copy ', False,0);
- Image1. Picture. Assign (ClipBoard);
- except
- end;
- End
- Procedure Tfrmmain. Formdestroy (Sender:tobject);
- Begin
- OleUninitialize;
- End
http://blog.csdn.net/yanjiaye520/article/details/7955671
Delphi get a picture of the website verification Code