This is a simple extension method that can be added to retrieve a bitmap of any control. It can be as specific as a text box, or image viewer, or as general as your entire application.
public static Bitmap GetImage(this Control obj)
{
obj.CreateGraphics();
var bmp = new Bitmap(obj.Width, obj.Height);
obj.DrawToBitmap(bmp, new Rectangle(0, 0, obj.Width, obj.Height));
return bmp;
}

Categories
Tag Cloud
Blog RSS
Comments RSS
Last 50 Posts
Back
Void « Default
Life
Earth
Wind
Water
Fire
Light 