Graphics3D Pen Alignment
Posted: Wed Apr 01, 2009 5:09 pm
I am drawing an horizontal line in the BeforeDrawAxes event and it is several pixels in width, i.e. g.Pen.Width = 10. The problem is the line centers on the y axis value. I tried using the alignment property, g.Pen.DrawingPen.Alignment, and it seems to have no effect. Please see code below:
Code: Select all
g.Pen.Color = newColor;
g.Pen.Width = Convert.ToInt32(this.tChart1.Axes.Right.CalcPosValue((double)this.lastBidSell) -
this.tChart1.Axes.Right.CalcPosValue((double)this.lastAskBuy));
g.Pen.DrawingPen.Alignment = PenAlignment.Left;
g.Line(this.chartRect.X + 1,
this.tChart1.Axes.Right.CalcPosValue((double)this.lastBidSell),
this.chartRect.Width,
this.tChart1.Axes.Right.CalcPosValue((double)this.lastBidSell));