如何在windows窗体中绘制负象限中的矩形c#

时间:2012-07-09 15:18:14

标签: c# graphics system.drawing

我想在负象限(原点的左侧和顶部)绘制矩形......请帮助

2 个答案:

答案 0 :(得分:1)

只需在X和Y位置使用负数。

Graphics.DrawRectangle(Pens.Black, -100, -100, 100, 100);

答案 1 :(得分:0)

Rectangle original = new Rectangle(10,10,50,50);
Rectangle negative = new Rectangle(original.Location.X - (original.Width * 2), original.Location.Y - (original.Height * 2), original.Width, original.Height);