Accord.Controls.DenavitHartenbergViewer.DrawArrows C# (CSharp) Method

DrawArrows() private method

Method to draw arrows to indicate the axis.
private DrawArrows ( Graphics &g, string topArrowText, string rightArrowText ) : void
g System.Drawing.Graphics Graphics variable to use to draw.
topArrowText string Text to draw on the top of the arrow.
rightArrowText string Text to draw on the right arrow.
return void
        private void DrawArrows(ref Graphics g, string topArrowText, string rightArrowText)
        {
            Pen pAxes = new Pen(Color.White);
            SolidBrush bText = new SolidBrush(Color.White);

            // Draw the top arrow
            g.DrawString(topArrowText, new Font("Arial", 8), bText,
                ArrowsBoundingBox.Left - 5, ArrowsBoundingBox.Top - 15,
                StringFormat.GenericDefault);

            g.DrawLine(pAxes,
                ArrowsBoundingBox.Left, ArrowsBoundingBox.Top,
                ArrowsBoundingBox.Left, ArrowsBoundingBox.Bottom);

            g.DrawLine(pAxes,
                ArrowsBoundingBox.Left, ArrowsBoundingBox.Top,
                ArrowsBoundingBox.Left - 5, ArrowsBoundingBox.Top + 10);

            g.DrawLine(pAxes,
                ArrowsBoundingBox.Left, ArrowsBoundingBox.Top,
                ArrowsBoundingBox.Left + 5, ArrowsBoundingBox.Top + 10);

            // Draw the right arrow
            g.DrawString(rightArrowText, new Font("Arial", 8), bText,
                ArrowsBoundingBox.Right - 10 + 12, ArrowsBoundingBox.Bottom - 6,
                StringFormat.GenericDefault);

            g.DrawLine(pAxes,
                ArrowsBoundingBox.Left, ArrowsBoundingBox.Bottom,
                ArrowsBoundingBox.Right, ArrowsBoundingBox.Bottom);

            g.DrawLine(pAxes,
                ArrowsBoundingBox.Right - 10, ArrowsBoundingBox.Bottom - 5,
                ArrowsBoundingBox.Right, ArrowsBoundingBox.Bottom);

            g.DrawLine(pAxes,
                ArrowsBoundingBox.Right - 10, ArrowsBoundingBox.Bottom + 5,
                ArrowsBoundingBox.Right, ArrowsBoundingBox.Bottom);
        }