/// <summary> /// Helper function to draw a crosshair. /// </summary> /// <param name="dc"></param> /// <param name="x"></param> /// <param name="y"></param> private void DrawCrossHair( Microsoft.SPOT.Presentation.Media.DrawingContext dc, int x, int y) { dc.DrawLine(pen, x - 10, y, x - 2, y); dc.DrawLine(pen, x + 10, y, x + 2, y); dc.DrawLine(pen, x, y - 10, x, y - 2); dc.DrawLine(pen, x, y + 10, x, y + 2); }
/// <summary> /// Handles the render event. /// </summary> /// <param name="dc"></param> public override void OnRender( Microsoft.SPOT.Presentation.Media.DrawingContext dc) { base.OnRender(dc); if (calibrating) { DrawCrossHair(dc, calPoints[currentCalPoint].x, calPoints[currentCalPoint].y); } else { dc.DrawEllipse(brush, pen, centerx, centery, r, r); } }