protected override void Draw(GLDrawContext context) { if (_isVisible) { context.DrawRectangle(MainWindow.GLSelectedPen, new Color() { A = 0x10, B = 0xf0 }, _rect); } }
protected override void Draw(GLDrawContext context) { context.PushTranslate(_origin.X, _origin.Y); context.PushRotateAt(30, 200, 200); context.PushOpacity(0.5f); var typeFace = new Typeface(new FontFamily("新宋体"), FontStyles.Normal, FontWeights.Normal, FontStretches.Normal); if (this == MainWindow.GLActiveVisual && this != MainWindow.GLSelectedVisual) { context.DrawText(PenF.NULL, Colors.Red, new FormattedText(_text, CultureInfo.CurrentUICulture, FlowDirection.LeftToRight, typeFace, 80, Brushes.Black), new PointF()); } else if (this == MainWindow.GLSelectedVisual) { context.DrawText(PenF.NULL, Colors.Blue, new FormattedText(_text, CultureInfo.CurrentUICulture, FlowDirection.LeftToRight, typeFace, 80, Brushes.Black), new PointF()); } else { context.DrawText(PenF.NULL, Colors.BurlyWood, new FormattedText(_text, CultureInfo.CurrentUICulture, FlowDirection.LeftToRight, typeFace, 80, Brushes.Black), new PointF()); } }