コード例 #1
0
ファイル: Form1.cs プロジェクト: VladGorbun/spp_po_2020
        private void RectAdd_Click(object sender, EventArgs e)
        {
            ClearAll();

            int X      = 0;
            int Y      = 0;
            int Height = 0;
            int Width  = 0;

            int.TryParse(RectPointX.Text, out X);
            int.TryParse(RectPointY.Text, out Y);
            int.TryParse(RectHeight.Text, out Height);
            int.TryParse(RectWidth.Text, out Width);

            myGraph.Point TLPoint = new myGraph.Point(X, Y);

            pen_.Color = Color.Blue;

            rectangle_ = new myGraph.Rectangle(TLPoint, Height, Width);

            using (Graphics Graph = PictB.CreateGraphics())
            {
                Graph.DrawRectangle(pen_, rectangle_.Point.X, rectangle_.Point.Y, rectangle_.Width, rectangle_.Height);
            }
        }
コード例 #2
0
ファイル: Form1.cs プロジェクト: VladGorbun/spp_po_2020
 private void ClearAll()
 {
     using (Graphics Graph = PictB.CreateGraphics())
     {
         Graph.Clear(Color.LightGray);
         points_.Clear();
         rectangle_ = null;
     }
 }