DrawOnBitmap
(
Int32 bitmapWidth
)
{
Debug.Assert(bitmapWidth > 0);
AssertValid();
// Note that the control height is independent of the control width.
Int32 iBitmapHeight = CalculateHeight();
Bitmap oBitmap = new Bitmap(bitmapWidth, iBitmapHeight);
using ( Graphics oGraphics = Graphics.FromImage(oBitmap) )
{
oGraphics.Clear(this.BackColor);
Draw( CreateDrawingObjects( oGraphics,
new Rectangle(0, 0, bitmapWidth, iBitmapHeight) ) );
}
return (oBitmap);
}