2016-04-24 73 views

回答

1

如果你是好与第三方库,我建议你这个NuGet包Freezer。它是免费的,支持HTML5/CSS3并且适合单个dll。

var screenshotJob = ScreenshotJobBuilder.Create("https://github.com") 
       .SetBrowserSize(1366, 768) 
       .SetCaptureZone(CaptureZone.FullPage) // Set what should be captured 
       .SetTrigger(new WindowLoadTrigger()); // Set when the picture is taken 

System.IO.File.WriteAllBytes("output.png", screenshotJob.Freeze()); 
+0

我不能使用此DLL(需要MVC和我的项目基于web的表单上) –

+0

嗯,这should'nt只要你不使用MVC暗示方法mattter。 – Ksv3n

+0

运行时代码抛出需要mvc dll的异常 –