使用 PointF 作为圆心绘制圆c#
我正在寻找这个,但我找不到任何东西。我的想法是我有一个像 (52.66, 60.11) 这样的 PointF,我想以此 PointF 为中心画一个空圆。我试图用 DrawEllipse 做,但它不关心中心!它只是一个矩形...我认为应该使用某种转换公式?
I was searching for this but I couldnt find anything. The idea is I have a PointF like (52.66, 60.11) and I want to draw an empty circle with this PointF as its center. I was trying to do with DrawEllipse but it does not care about the center! it is just a rectangle...I think some kind of conversion formula should be used?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您可以根据中心和半径计算矩形的坐标:
You can compute the coordinates of the rectangle from the center and radius:
心不在焉:(
这个没有测试过)
用它将圆形的参数转换为矩形进行绘制。
out of mind:
(This is not tested)
Use it to convert the parameter of the circle to a rectangle for drawing.
如果你画一个具有相同高度和宽度的椭圆,你会得到一个圆,如果你需要知道绘制圆的正方形的左上角和右下角点的坐标,那么知道中间点(中心)是相当平庸的。
if you draw an ellipse with same height and width you get a circle, if you need to know the Top-Left and Bottom-Right point's coordinates of the square in which your circle is drawn, it's quite banal knowing the middle point (center).