コード例 #1
0
        public override void Draw(int gridSize, Graphics g)
        {
            using (Pen pen = new Pen(new SolidBrush(Color), MeasurementWidth))
            {
                g.DrawLine(pen, Start.ToPoint(gridSize), End.ToPoint(gridSize));

                // figure out the angle
                double degrees = DrawFacts.ComputeSlopeInDegrees(Start, End);

                // we need to translate the ends at each of the points (start and end)
                DrawEndLine(gridSize, g, Start, degrees, pen);
                DrawEndLine(gridSize, g, End, degrees, pen);

                DrawRotatedMeasureText(gridSize, g, degrees);
            }
        }
コード例 #2
0
ファイル: Rectangle.cs プロジェクト: AlexGhiondea/DrawIt
 public override bool ContainsPoint(int gridSize, Point p)
 {
     //check all 4 lines.
     return(DrawFacts.PointOnRectangle(TopLeft.ToPoint(gridSize), BottomRight.ToPoint(gridSize), p, Width));
 }
コード例 #3
0
 public override bool ContainsPoint(int gridSize, Point p)
 {
     return(DrawFacts.PointOnLineSegment(Start.ToPoint(gridSize), End.ToPoint(gridSize), p, Width));
 }
コード例 #4
0
ファイル: Image.cs プロジェクト: AlexGhiondea/DrawIt
 public override bool ContainsPoint(int gridSize, Point p)
 {
     return(DrawFacts.PointInsideRectangle(Start.ToPoint(gridSize), BottomRight.ToPoint(gridSize), p));
 }