Control als Bitmap

Thomas Wölfer
03. November 2006
Angenommen, man benötigt das Bild eines Controls als Bitmap - also zum Beispiel ein Bitmap einer CheckBox, die als Bild in einem Dialog eingeblendet werden soll: Woher nehmen, und nicht stehlen? Ganz einfach:
Bitmap bm = new Bitmap(30,30);
CheckBox cb = new CheckBox();
cb.DrawToBitmap(bm, new Rectangle(0,0,30, 30));