static void canvas_EvRedraw(object sender, RedrawEventArgs e) { var p = e.Painter; p.Clear(0); Ellipse2d el1 = new Ellipse2d(new Point2d(mousex, mousey), 200, 5, 1.0); Ellipse2d el2 = new Ellipse2d(new Point2d(400, 500), 300, 5, -1); p.Color = RGB.Red; p.DrawEllipse(el1.Center.X, el1.Center.Y, el1.MajorRadius, el1.MinorRadius, el1.Rotation); p.Color = RGB.Green; p.DrawEllipse(el2.Center.X, el2.Center.Y, el2.MajorRadius, el2.MinorRadius, el2.Rotation); var intpts = Intersect2d.EllipseEllipse(el1, el2); if (intpts != null) { p.Color = RGB.Yellow; foreach (Point2d pt in intpts) { p.DrawMark(pt.X, pt.Y, MarkType.DiagonalCross, 10); } } }
protected void OnRedraw(Object sender, RedrawEventArgs e) { logger.Trace("OnRedraw() received..."); // TODO 3: [performance] invalidate only what really changed (could be tricky) Invalidate(); }
protected virtual void OnPaint(RedrawEventArgs e) { if (Paint != null) { Paint(this, e); } }
protected void RaiseRedrawEvent(RedrawEventArgs e) { logger.Trace("Raising redraw event..."); EventHandler <RedrawEventArgs> handler = Redraw; if (handler != null) { handler(this, e); } }
void OnDrawAreaRedraw(object sender, RedrawEventArgs e) { if (redraw_backbuffer) { if (!RedrawBackbuffer(e.Painter)) { return; //no active drawing } screen_dirty = new Rectangle2i(0, 0, backbuffer.Width - 1, backbuffer.Height - 1); //entire screen is now dirty } RedrawOverlay(); }
private void Redraw(object sender, RedrawEventArgs e) { // if there's an area to redraw, redraw it // otherwise redraw the entire buffer if (e != null && e.HasArea) { Draw(e.Area.Left, e.Area.Top, e.Area.Width, e.Area.Height); } else { Draw(); } this.Console.SetCursorPosition(0, 0); }
protected virtual void OnRedraw(RedrawEventArgs e) { // Start the redraw. Given the window handle, the OS fills in RedrawWimpBlock // with details of what needs redrawing. int more = Wimp.RedrawWindow(ref e.Redraw); // The origin of the window only needs to be calculated once before entering // the redraw loop. e.Origin = WimpWindow.GetOrigin(ref e.Redraw.Visible, ref e.Redraw.Scroll); while (more != 0) { OnPaint(e); more = Wimp.GetRectangle(ref e.Redraw); } }