Sae*_*ani 1 c# geometry bitmap picturebox draw
我正在寻找这个,但我找不到任何东西。我的想法是我有一个像 (52.66, 60.11) 这样的 PointF,我想以此 PointF 为中心画一个空圆。我试图用 DrawEllipse 做,但它不关心中心!它只是一个矩形...我认为应该使用某种转换公式?
您可以根据中心和半径计算矩形的坐标:
float x = center.X - radius;
float y = center.Y - radius;
float width = 2 * radius;
float height = 2 * radius;
graphics.DrawEllipse(pen, x, y, width, height);
Run Code Online (Sandbox Code Playgroud)