Is it possible to convert a Html Control to an image in C#?
Is there any C# method where I can pass the Html Control object and return an image of that html control?
Consider this (untested!) library over at guangmingsoft called htmlsnapshot.
add a reference to the htmlsnap2.dll
There's a sample project there for download.
Here's their sample code, lifted straight from that link:
snap = new CHtmlSnapClass();
snap.Url("www.google.com", "*")
byte[] data = (byte[])snap.GetImageBytes(".jpg");
//byte[] data = (byte[])snap.GetThumbImageBytes(".jpg", 100, 100, 1);
FileStream fs = File.OpenWrite(@"c:\1.jpg");
BinaryWriter br = new BinaryWriter(fs);
br.Write(data);
br.Close();
fs.Close();
Update If you wanted only a particular control, you could write yourself a page whose job is to re-render your target control as the only bits of HTML on the page.