Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
private void Form1_Paint(object sender, PaintEventArgs e) { Pen p = new Pen(Brushes.Black, 1); e.Graphics.DrawRectangle(p, 3, 3, 89, 30); }
为什么这段代码会产生一个 90px 宽 / 31px 高的盒子?即比请求大一个像素。顺便说一句: FillRectangle 工作正常。
我想这是因为该命令定义了矩形的内部大小并在其周围绘制了边框。