/// <summary>Renders a straight line from the previous point to this one.</summary>
        public override void RenderLine(CanvasContext context)
        {
            // Grab the raw drawing data:
            DynamicTexture data = context.ImageData;

            // Invert y:
            int endY   = data.Height - (int)Y;
            int startY = data.Height - (int)Previous.Y;

            // Grab X:
            int endX   = (int)X;
            int startX = (int)Previous.X;

            data.DrawLine(startX, startY, endX, endY, context.StrokeColour);
        }
예제 #2
0
        /*
         * public void DrawRectangle(int x, int y, int w, int h, Brush brush)
         * {
         *  texture.DrawRectangle(x, (int)Size.Y - h, w, h, brush);
         * }
         */

        public void DrawLine(int x1, int y1, int x2, int y2, Pen pen)
        {
            texture.DrawLine(x1, (int)Size.Y - y1, x2, (int)Size.Y - y2, pen);
        }