我有一个 Visual Basic PowerPacks 椭圆形控件,在窗体上显示为圆形,我想从最后一个位置的中心增加它的大小,这样我就可以从各个方面增加它,即中心,我该怎么做,我试过这个。
//This code to draw circle on the clicked area.
MouseEventArgs clickArgs = (MouseEventArgs)e; Graphics graphics = this.CreateGraphics();
float circlesize = 100;
int x = Convert.ToInt32(clickArgs.X - circlesize / 2);
int y = Convert.ToInt32(clickArgs.Y - circlesize / 2);
ovalShape1.Location = new Point(x, y);
//To increase its size
ovalShape1.Width = ovalShape1.Width + 10;
ovalShape1.Height = ovalShape1.Height + 10;
当前代码从不正确的最后一个 X、Y 位置增加大小。:(