 <p>What happens when you just do this?</p> <pre><code>public Bitmap GetBitmap() { Bitmap bmp = new Bitmap(codeEditor.Width, codeEditor.Height); Rectangle rect = new Rectangle(0, 0, codeEditor.Width, codeEditor.Height); codeEditor.DrawToBitmap(bmp, rect); return bmp; } </code></pre>