Performs basic painting operations using GDI+ (Graphics object) drawing

Namespace: Dapfor.Net.Ui
Assembly: Dapfor.Net (in Dapfor.Net.dll) Version: 2.10.3.24917 (2.10.3.24917)

Syntax

C#
public class GDIPlusRender : IRender
Visual Basic
Public Class GDIPlusRender
	Implements IRender
Visual C++
public ref class GDIPlusRender : IRender
F#
type GDIPlusRender =  
    class
        interface IRender
    end

Examples

 Copy imageCopy
public void CellCustomDraw(Grid grid)
{
    //Demonstrates, how to custom draw in cell. 
    //The delegate is called while the cell's painting
    grid.PaintCell += delegate(object sender, PaintCellEventArgs e)
    {
        //Draw a button in the cell's bounds. 
        Color startColor = Color.LightGray;
        Color endColor = Color.LightSlateGray;

        //Take into account, that the row can be selected.
        if (e.Cell.Row != null && e.Cell.Row.Selected)
        {
            startColor = PaintHelper.AlphaBlend(startColor, grid.Selection.Color);
            endColor = PaintHelper.AlphaBlend(endColor, grid.Selection.Color);
        }

        //Draw the background
        Appearance appearance = new Appearance(SystemColors.GrayText, startColor, true, endColor, GradientDirection.Vertical);
        e.Render.DrawCaption(appearance, ElementState.Normal, e.Cell.VirtualBounds, BorderSide.All, e.Graphics);

        //Prevent from background erasing
        e.Parts &= e.Parts ^ (PaintPart.Background | PaintPart.Borders);

        //Set a new text color
        e.Appearance.ForeColor = Color.Yellow;

        //Do default painting without the text drawing
        e.PaintAll();
    };
}

Inheritance Hierarchy

System..::..Object
  Dapfor.Net.Ui..::..GDIPlusRender

See Also