Search code examples
c#geckofx

C# Geckofx Browser Image Download


I'm trying to download an image from a page. But it only show (Image Found) if i manually click on right click, i want it to download automatically anyone now a better solution ? Tried

GeckoImageElement img = (GeckoImageElement)wb1.Document.GetElementById("imgcode"); 
if (wb1.CopyImageContents())

MessageBox.Show("done");

if (Clipboard.ContainsImage())

MessageBox.Show("Image Found!!");

Solution

  • Geckofx contains a SaveImageElement class which may help you. Eg. the following should copy the 'imgcode' img to the clipboard:

    wb1.CopyGeckoImageElementToPng(img, 0,0,img.Width,img.Height);