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 }); }