DigitalClockDisplay.OnDraw C# (CSharp) Method

OnDraw() public method

public OnDraw ( DrawEvent devent ) : void
devent NewTOAPIA.UI.DrawEvent
return void
    public void OnDraw(DrawEvent devent)
	{
        IGraphPort graphPort = devent.GraphPort;


		Kernel32.GetLocalTime(out fThisTime);

        fPen = Guid.NewGuid();
        fBrush = Guid.NewGuid();
        graphPort.CreateCosmeticPen(PenStyle.Dash, RGBColor.Black, fPen);
        graphPort.CreateBrush(GDI32.BS_SOLID, 0, RGBColor.Red, fBrush);
        
        //graphPort.DrawingColor = RGBColor.Red;
        graphPort.UseDefaultBrush();
        graphPort.UseDefaultPen();
        graphPort.SetDefaultPenColor(RGBColor.Black);
        graphPort.SetDefaultBrushColor(RGBColor.Red);

        DrawHour(graphPort);

        DrawMinutes(graphPort);

        DrawSeconds(graphPort);

        // Copy the current time to being the last time
        fLastTime.Hour = fThisTime.Hour;
        fLastTime.Minute = fThisTime.Minute;
        fLastTime.Second = fThisTime.Second;

        // Restore the world transform so drawing
        // is normal for whomever is next
        //graphPort.SetWorldTransform(oldTransform);
    }