Пример #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="pText"></param>
        /// <param name="pSize"></param>
        /// <param name="pX"></param>
        /// <param name="pY"></param>
        /// <param name="pColor"></param>
        public override void DrawText(string pText, int pSize, int pX, int pY, SMX.Maths.Color4 pColor)
        {
            System.Drawing.Font font  = new Font("Arial", pSize, FontStyle.Bold);
            SolidBrush          brush = new SolidBrush(pColor.ToGDI());

            SMX.Maths.Rectangle r = GetScreenCoords(pX, pY, 0, 0);
            mGraphics.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.Bilinear;
            mGraphics.DrawString(pText, font, brush, new PointF(r.X, r.Y));
        }
Пример #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="pX"></param>
        /// <param name="pY"></param>
        /// <param name="pDestX"></param>
        /// <param name="pDestY"></param>
        /// <param name="pWidth"></param>
        /// <param name="pDashed"></param>
        /// <param name="pColor"></param>
        public override void DrawLine(float pX, float pY, float pDestX, float pDestY, float pWidth, bool pDashed, SMX.Maths.Color4 pColor)
        {
            Pen pen = new Pen(pColor.ToGDI(), pWidth);

            if (pDashed)
            {
                pen.DashStyle = System.Drawing.Drawing2D.DashStyle.Dash;
            }
            else
            {
                pen.DashStyle = System.Drawing.Drawing2D.DashStyle.Solid;
            }

            Point start = GetScreenCoords(pX, pY, 1, 1).ToGDI().Location;
            Point end   = GetScreenCoords(pDestX, pDestY, 1, 1).ToGDI().Location;

            mGraphics.DrawLine(pen, start, end);
        }