使用TWebBrowser,如何把正在浏览的网页用图片的形式保存下来?(300分)

  • 主题发起人 主题发起人 yifeng
  • 开始时间 开始时间
Y

yifeng

Unregistered / Unconfirmed
GUEST, unregistred user!
注意:不是直接print screen or Alt-printScreen,因为有的时候窗口没有最大化,
网页只能被看见一部分, 同时我不希望我的程序的界面(诸如菜单条等)和网页一起
保存下来。
如果网页的垂直方向上大于屏幕的高,则只保存网页第一行开始的第一屏。

欢迎建议!谢谢
 
问题提前
 
A Sample:

procedure TForm1.Button1Click(Sender: TObject);
var
ViewObject: IViewObject;
sourceDrawRect: TRect;
begin
if Webbrowser1.Document <> nil then
try
webbrowser1.Document.QueryInterface(IViewObject, ViewObject);
if ViewObject <> nil then
try
sourceDrawRect := Rect(0, 0, Image1.Width, Image1.Height);
ViewObject.Draw(DVASPECT_CONTENT, 1, nil, nil, Self.Handle,
image1.Canvas.Handle, @sourceDrawRect, nil, nil, 0);
finally
ViewObject._Release;
end;
except
end;
end;
 
hi, thank you. I test it and it pass.
But can you tell me where you get this? I look it for a long time in MSDN,
but as you know it's terrible for user: too info in it!

Thank you for your help, expect your reply.
 
http://members.home.net/hfournier去看看吧
 
接受答案了.
 
后退
顶部