Mike-Ward.Net

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

How to Choose the Right VPN Service
Two Handy Command Line Scripts
Tweetz 1.3.2
Tweetz 1.3 Release
Mithril Rising
Tweetz Release 1.2.4 - Screen Off Detection
Tweetz Desktop Support for 280 Characters
More... (1084)

Donate