我试图计算如何使用计时器收缩我在窗体上绘制的矩形并从底部收缩它而不改变矩形的宽度,特别是我想从底部缩小它的高度矩形的顶部到矩形的顶部。到目前为止,我只能增加它的大小,所以我坚持从底部向上减小它的大小。
static int size = 195;
private void timer_Tick(object sender, EventArgs e)
{
g = this.CreateGraphics();
//This is the rectangle i want to reduce its height from bottom up
g.FillRectangle(brush, new Rectangle(115, 205, 20, size));
//the height decreasing one by one as the timer is started
size--:
}