07-08-19 12:27 PM
08-08-19 11:03 AM
08-08-19 12:32 PM
12-08-19 12:02 PM
var bmpScreenshot = new Bitmap(width, height, PixelFormat.Format32bppArgb); var gfxScreenshot = Graphics.FromImage(bmpScreenshot); gfxScreenshot.CopyFromScreen(left, top, 0, 0, bmpScreenshot.Size, CopyPixelOperation.SourceCopy); var filename = "C:\\Temp\\TestIEWebpage.png"; bmpScreenshot.Save(filename, ImageFormat.Png);
12-08-19 04:55 PM
Just tested the solution @Dave Morris posted. While quick and efficient, it's still limited to the screen bounds for what it'll actually fill in. (I set it to a height of 4096 for testing.)
It sounds like you're wanting something that can capture beyond the bounds (cue Zone of the Enders music); I've found a couple libraries out there, but they seem to want a pre-defined URL so they can open it in a browserless manner. (IE: http://4rapiddev.com/csharp/c-save-web-page-url-to-image/#prettyPhoto ) If you don't need to login to whichever page it is, something like this might work.
Alternatively, you can leverage a virtual printer driver and send Ctrl+P to the browser. This one seems to be free and has no watermark: https://download.cnet.com/PDFill-Free-PDF-Editor-Basic/3000-18497_4-77622696.html?part=dl-&subj=dl&tag=button (Disregard PDF in the title - it'll still save images instead.)
Edit: Or if they'll accept a .XPS file, that print functionality is already available natively.
------------------------------
Ami Barrett
Lead RPA Software Developer
Solai & Cameron
America/Chicago
------------------------------