public static void PaintHandle(IPaintTo3D paintTo3D, PointF pf, int width, Color color) { paintTo3D.SetColor(color); paintTo3D.SetLineWidth(null); paintTo3D.SetLinePattern(null); paintTo3D.Line2D((int)pf.X - width, (int)pf.Y - width, (int)pf.X - width, (int)pf.Y + width); paintTo3D.Line2D((int)pf.X - width, (int)pf.Y + width, (int)pf.X + width, (int)pf.Y + width); paintTo3D.Line2D((int)pf.X + width, (int)pf.Y + width, (int)pf.X + width, (int)pf.Y - width); paintTo3D.Line2D((int)pf.X + width, (int)pf.Y - width, (int)pf.X - width, (int)pf.Y - width); //paintTo3D.Point2D((int)pf.X + width, (int)pf.Y + width); //paintTo3D.Point2D((int)pf.X + width, (int)pf.Y - width); //paintTo3D.Point2D((int)pf.X - width, (int)pf.Y + width); //paintTo3D.Point2D((int)pf.X - width, (int)pf.Y - width); }
public static void PaintHandle(IPaintTo3D paintTo3D, int x, int y, int width, Color color) { paintTo3D.SetLineWidth(null); // dünnstmöglich paintTo3D.SetLinePattern(null); paintTo3D.SetColor(color); paintTo3D.Line2D(x - width, y - width, x - width, y + width); paintTo3D.Line2D(x - width, y + width, x + width, y + width); paintTo3D.Line2D(x + width, y + width, x + width, y - width); paintTo3D.Line2D(x + width, y - width, x - width, y - width); // ohne die folgenden Aufrufe fehlt meist ein Punkt im Quadrat // hängt vom OpenGl Treiber ab: manchmal sind diese Punkte versetzt //paintTo3D.Point2D(x - width, y - width); //paintTo3D.Point2D(x - width, y + width); //paintTo3D.Point2D(x + width, y + width); //paintTo3D.Point2D(x + width, y - width); }
private void RepaintZoomRect(Rectangle IsInvalid, IView View, IPaintTo3D PaintToActive) { if (View != activeView) { return; // nur ein Fadenkreuz bzw. Rechteck } Color bckgnd = Frame.GetColorSetting("Colors.Background", Color.AliceBlue); Color infocolor; if (bckgnd.GetBrightness() > 0.5) { infocolor = Color.Black; } else { infocolor = Color.White; } Rectangle ClipRect = View.Canvas.ClientRectangle; switch (Mode) { case 0: // Fadenkreuz zeichnen PaintToActive.SetColor(infocolor); PaintToActive.Line2D(FirstPoint.X, ClipRect.Top, FirstPoint.X, ClipRect.Bottom); PaintToActive.Line2D(ClipRect.Left, FirstPoint.Y, ClipRect.Right, FirstPoint.Y); break; case 1: // Rechteck zeichnen PaintToActive.SetColor(infocolor); PaintToActive.Line2D(FirstPoint.X, FirstPoint.Y, SecondPoint.X, FirstPoint.Y); PaintToActive.Line2D(SecondPoint.X, FirstPoint.Y, SecondPoint.X, SecondPoint.Y); PaintToActive.Line2D(SecondPoint.X, SecondPoint.Y, FirstPoint.X, SecondPoint.Y); PaintToActive.Line2D(FirstPoint.X, SecondPoint.Y, FirstPoint.X, FirstPoint.Y); break; } }