Smrf.NodeXL.ExcelTemplate.LegendControlBase.DrawOnBitmap C# (CSharp) Method

DrawOnBitmap() public method

public DrawOnBitmap ( Int32 bitmapWidth ) : Bitmap
bitmapWidth System.Int32
return System.Drawing.Bitmap
    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);
    }