TextShape CreateCustomTextualMarker(ComplexShape markerShape) { RectangleF2D box = new RectangleF2D(-15, -15, 30, 30); EllipseShape eShape = new EllipseShape(box); TextShape txt = new TextShape(); eShape.BeginUpdate(); eShape.Name = "bg"; eShape.Appearance.ContentBrush = new SolidBrushObject(Color.White); eShape.Appearance.BorderBrush = new SolidBrushObject(Color.Black); eShape.Appearance.BorderWidth = 2; eShape.EndUpdate(); txt.BeginUpdate(); txt.Name = "marketText"; txt.Text = "Test"; txt.Box = box; txt.AppearanceText.TextBrush = new SolidBrushObject(Color.Black); txt.AppearanceText.Font = new Font("Tahoma", 8f); txt.ShadingFlags = ShadingFlags.NoShading; txt.EndUpdate(); markerShape.AddRange(new BaseShape[] { eShape, txt }); return(txt); }
void CreateCustomIndicator(ComplexShape rootShape) { rootShape.Collection.Clear(); //remove old shapes EllipseShape el = new EllipseShape(new RectangleF2D(0, 0, 100, 100)); //ellipse BoxShape box = new BoxShape(new RectangleF2D(20, 40, 60, 20)); //horz box box.BeginUpdate(); box.Appearance.ContentBrush = new SolidBrushObject(Color.White); box.Name = "horz"; box.EndUpdate(); el.BeginUpdate(); el.Name = "el"; el.Appearance.ContentBrush = new SolidBrushObject(Color.Red); el.EndUpdate(); rootShape.AddRange(new BaseShape[] { el, box }); }
private void CreateComplexNeedle(INeedle needle) { ComplexShape needleShape = (ComplexShape)needle.Shape; needleShape.Collection.Clear(); PolylineShape basic = new PolylineShape(new PointF[] { new PointF(25, 20), new PointF(100, 0), new PointF(25, -20), new PointF(95, 0), new PointF(25, 20) }); basic.Appearance.ContentBrush = new SolidBrushObject(Color.Azure); basic.Name = "basic"; PolylineShape cap = new PolylineShape(new PointF[] { new PointF(100, 0), new PointF(105, 5), new PointF(110, 0), new PointF(105, -5) }); cap.Appearance.ContentBrush = new SolidBrushObject(Color.BurlyWood); cap.Name = "cap"; needleShape.AddRange(new BaseShape[] { basic, cap }); }