DrawRectangle() public method

public DrawRectangle ( Pen penn, RectangleF rect ) : void
penn System.Drawing.Pen
rect System.Drawing.RectangleF
return void
Example #1
0
        public void Draw(HUD e)
        {
            CalculateDistance(e);

            var pen = new Pen(Color.FromName(LineColor), LineWidth);

            double offset_x = CenterOffset * e.Width * 0.5;
            double offset_y = CenterOffset * e.Height * 0.5;

            e.DrawLine(pen, pointX, 0, pointX, pointY - offset_y);
            e.DrawLine(pen, pointX, pointY + offset_y, pointX, e.Height);
            e.DrawLine(pen, 0, pointY, pointX - offset_x, pointY);
            e.DrawLine(pen, pointX + offset_x, pointY, e.Width, pointY);
            e.DrawRectangle(pen, pointX - (RectSize * offset_x), pointY - (RectSize * offset_y), 2 * RectSize * offset_x, 2 * RectSize * offset_y);
        }