protected override void InitializeComponents(RenderTarget rt) { base.InitializeComponents(rt); fillBrush = Color.Blue.SolidBrush(rt); fillBrush.Opacity = 0.5f; frameBrush = Color.White.SolidBrush(rt); }
protected CoordinateTargetView(Target target, RenderTarget canvas, D2DFactory factory, CoordinateSystem coordinateSystem) : base(target) { if (target == null) { return; } this.canvas = canvas; this.factory = factory; CoordinateSystem = coordinateSystem; position = coordinateSystem.CoordinateToPoint(target.CurrentCoordinate); //计算显示坐标 activeRect = new Rect { Left = (int)position.X - activeRectRadius, Top = (int)position.Y - activeRectRadius, Right = (int)position.X + activeRectRadius, Bottom = (int)position.Y + activeRectRadius }; targetController = TargetManagerFactory.CreateTargetManagerController(); targetViewBrush = canvas.CreateSolidColorBrush(Tools.GetColorFFromRgb(255, 128, 0)); //橘黄 }
public override void DrawZoomView(RectF coverRect, RenderTarget rt, Brush fillBrush, Brush frameBrush, float strokeWidth) { Ellipse e = new Ellipse(coverRect.Center(), coverRect.Width / 2, coverRect.Width / 2); rt.FillEllipse(e, fillBrush); rt.DrawEllipse(e, frameBrush, strokeWidth); }
public TextTargetView(Target target, TextDisplayer displayer, Point2F drawPoint) : base(target) { _displayer = displayer; leftTop = drawPoint; _columnWidth = displayer.ColumnWidth; _rects = CalculateRects(); activeRect = CalculateActiveRect(); _texts = new List <string>(); TargetTrack track = (TargetTrack)target; _texts.Add(track.TrackId.ToString()); _texts.Add(track.Az.ToString("0.0")); _texts.Add(track.El.ToString("0.0")); _texts.Add(track.Dis.ToString("0.0")); _texts.Add(track.Speed.ToString("0.0")); _borderBrush = displayer.Canvas.CreateSolidColorBrush(new ColorF(1, 1, 1)); DWriteFactory dw = DWriteFactory.CreateFactory(); _inactiveTextFormat = dw.CreateTextFormat("宋体", 20); _inactiveTextFormat.TextAlignment = TextAlignment.Center; _inactiveBrush = displayer.Canvas.CreateSolidColorBrush(new ColorF(0, 1, 1)); _activeBrush = displayer.Canvas.CreateSolidColorBrush(new ColorF(0, 0, 1)); }
const int dashStyleTimes = 10; //显示边界风格切换的次数,到达10次之后切换边界风格,DashDot->Dash或Dash->DashDot public GraphicWaveGateView(WaveGate waveGate, OverViewDisplayer ovd) { displayer = ovd; canvas = displayer.Canvas; this.waveGate = waveGate; waveGateBrush = canvas.CreateSolidColorBrush(waveGate.IsSemiAuto ? Tools.GetColorFFromRgb(255, 255, 0) : Tools.GetColorFFromRgb(245, 222, 179)); coodinateSystem = displayer.coordinateSystem; //Selected = false; PolarCoordinate c = new PolarCoordinate { Az = waveGate.BeginAngle, //ProjectedDis = waveGate.BeginDistance; //之前版本将距离赋给ProjectedDis Dis = waveGate.BeginDistance }; innerLeft = coodinateSystem.CoordinateToPoint(c); c.Az = waveGate.EndAngle; //c.ProjectedDis = waveGate.EndDistance; //之前版本将距离赋给projectedDis c.Dis = waveGate.EndDistance; outterRight = coodinateSystem.CoordinateToPoint(c); geometry = coodinateSystem.BuildWaveGateGeometry(innerLeft, outterRight); }
protected override void InitializeComponents(RenderTarget rt) { base.InitializeComponents(rt); textBrush = DisplayModel.FontColor.SolidBrush(rt); DWriteFactory dw = DWriteFactory.CreateFactory(); textFormat = dw.CreateTextFormat(DisplayModel.FontName, DisplayModel.FontSize); dw.Dispose(); }
protected override void InitializeComponents(RenderTarget rt) { base.InitializeComponents(rt); frameBrush = Color.White.SolidBrush(rt); normalFillBrush = Color.Yellow.SolidBrush(rt); normalFillBrush.Opacity = 0.5f; selectedFillBrush = Color.Orange.SolidBrush(rt); selectedFillBrush.Opacity = 0.5f; }
protected override void InitializeComponents(RenderTarget rt) { base.InitializeComponents(rt); markerBrush = Color.Gray.SolidBrush(rt); selectedMarkerBrush = Color.Yellow.SolidBrush(rt); textBrush = Color.White.SolidBrush(rt); string fontName = "微软雅黑"; textFormat = fontName.MakeFormat(10); }
protected override void InitializeComponents(RenderTarget rt) { base.InitializeComponents(rt); TargetBrush = Color.Red.SolidBrush(rt); TagBrush = Color.Red.SolidBrush(rt); TextBrush = Color.White.SolidBrush(rt); var fontName = "微软雅黑"; TextFormat = fontName.MakeFormat(10); }
protected override void InitializeComponents(RenderTarget rt) { base.InitializeComponents(rt); normalLineBrush = Model.LineColor.SolidBrush(rt); selectedLineBrush = Model.SelectedLineColor.SolidBrush(rt); normalTextBrush = Model.FontColor.SolidBrush(rt); selectedTextBrush = Model.SelectedFontColor.SolidBrush(rt); using (var dw = DWriteFactory.CreateFactory()) { normalTextFormat = dw.CreateTextFormat(Model.FontName, Model.FontSize); selectedTextFormat = dw.CreateTextFormat(Model.SelectedFontName, Model.SelectedFontSize); } strokeStyle = rt.Factory.CreateStrokeStyle(new StrokeStyleProperties { DashStyle = DashStyle.DashDot }); }
protected override void InitializeComponents(RenderTarget rt) { base.InitializeComponents(rt); normalLineBrush?.Dispose(); selectedLineBrush?.Dispose(); normalTextFormat?.Dispose(); selectedTextFormat?.Dispose(); normalTextBrush?.Dispose(); selectedTextBrush?.Dispose(); normalLineBrush = Model.LineColor.SolidBrush(rt); selectedLineBrush = Model.SelectedLineColor.SolidBrush(rt); normalTextBrush = Model.FontColor.SolidBrush(rt); selectedTextBrush = Model.SelectedFontColor.SolidBrush(rt); using (var dw = DWriteFactory.CreateFactory()) { normalTextFormat = dw.CreateTextFormat(Model.FontName, Model.FontSize); selectedTextFormat = dw.CreateTextFormat(Model.SelectedFontName, Model.SelectedFontSize); } }
protected override void InitializeComponents(RenderTarget rt) { base.InitializeComponents(rt); signalBrush = rt.CreateSolidColorBrush(Color.GreenYellow.ToColorF()); }
protected override void InitializeComponents(RenderTarget rt) { antennaBrush = antennaColor.SolidBrush(rt); }
protected override void InitializeComponents(RenderTarget rt) { base.InitializeComponents(rt); LineBrush = Color.Red.SolidBrush(rt); Model = 30; }
public virtual void DrawZoomView(RectF coverRect, RenderTarget rt, Brush fillBrush, Brush frameBrush, float strokeWidth) { rt.FillRectangle(coverRect, fillBrush); rt.DrawRectangle(coverRect, frameBrush, strokeWidth); }
protected override void InitializeComponents(RenderTarget rt) { base.InitializeComponents(rt); fillBrush = Color.Yellow.SolidBrush(rt); fillBrush.Opacity = 0.8f; }
protected override void InitializeComponents(RenderTarget rt) { base.InitializeComponents(rt); axisBrush = Color.White.SolidBrush(rt); }
protected override void InitializeComponents(RenderTarget rt) { base.InitializeComponents(rt); fillBrush = Color.Red.SolidBrush(rt); //需要动态计算画刷的颜色 }