如何在GeckoFX浏览器中从页面获取图像?
我知道我可以简单地获取'src'属性的值,然后使用WebClient来下载文件,但我需要从浏览器中获取它,因为否则图片将在下次下载时更改。
答案 0 :(得分:1)
但是,右键单击图像时,可以将此代码放入etc上下文菜单条中:
if(geckoWebBrowser1.CopyImageContents())//if image contents can be copied...
{
System.Drawing.Image img = Clipboard.GetImage();//copy image into variable
//here you can use a folder browser dialog to locate path manualy
img.Save(Application.StartupPath + "tempImg.jpg");//will save image to path
//last two lines is optional and can open same image in default image preview program
string fak = Application.StartupPath + "tempImg.jpg";
System.Diagnostics.Process.Start(fak);
}
答案 1 :(得分:0)
Geckofx 13支持:Image Creator in geckofx