コード例 #1
0
        private void DrawMarker(Graphics draw, VectorPoint marker)
        {
            if (String.IsNullOrWhiteSpace(marker.Color))
            {
                return;
            }
            Brush brush = GetBrush(marker.Color);

            if (brush == null)
            {
                return;
            }

            Pen p = new Pen(brush);

            if (marker.Marker.Equals("cross"))
            {
                // draw 2 lines
                draw.DrawLine(p, ScalePosition(marker.X - 3, marker.Y - 3), ScalePosition(marker.X + 3, marker.Y + 3));
                draw.DrawLine(p, ScalePosition(marker.X + 3, marker.Y - 3), ScalePosition(marker.X - 3, marker.Y + 3));
            }
            if (marker.Marker.Equals("circle"))
            {
                var circlebounds = new Rectangle(ScalePosition(marker.X - 4, marker.Y - 4),
                                                 new Size(Scale(8, 8)));
                draw.DrawEllipse(p, circlebounds);
            }
        }
コード例 #2
0
        private void DrawVectorLine(Graphics draw, Brush brush, VectorPoint start, VectorPoint end)
        {
            if (brush == null)
            {
                return;
            }
            Pen p = new Pen(brush);

            draw.DrawLine(p, ScalePosition(start.X, start.Y), Scale(end.X, end.Y));
        }