Control.DrawToBitmap Method

A requirement from one of our clients required that I capture an image of a control to a bitmap. Being a Win32 programmer from days gone by I figured no problem. Grab a device context, do some bit blasting and I’m done. It’s a little harder in .Net since you have to do a platform invoke for the BitBlt operation but very doable.

Well wouldn’t you know it, just about the time I finish up the routine I discover that .Net 2.0 has a new method called Control.DrawToBitmap that does this very thing. There are a few restrictions like not working with RichText controls or ActiveX controls. Worked like a charm for me.

← newer older →
.Net, Technology, Life, Whatever

Recent Posts

Tweetz 2.0.0 Released
Tweetz 2.0 Beta
VSColorOutput 2.7 - Time Stamps
Fixed Focal-Length Eyeglasses, a Programmer's Best Friend
How to Choose the Right VPN Service
Two Handy Command Line Scripts
Tweetz 1.3.2
More... (1088)