Fork me on GitHub

Install the DynamicImage.Extensions.WebsiteScreenshot package to get this extension. There is some background information in this blog post.

@Html.DynamicImageTag(b => b.WithLayer(
	new WebsiteScreenshotLayerBuilder().WebsiteUrl("http://www.apple.com")
		.Timeout(15000).BrowserWidth(1024)
		.WithFilter(FilterBuilder.Resize.ToWidth(500))
		.WithFilter(FilterBuilder.Border.Width(1).Fill(Colors.Black))
		.WithFilter(FilterBuilder.DropShadow)
))