{ "TableName": "Policy",
"Item": {
"PolicyNumber": { "S": "10001" },
"Name": { "S": "Test10001" }
}
}
我想在代码
上的这个圆圈的中心画一个小圆圈答案 0 :(得分:0)
您只需使用半径大小来偏移位置
偏移量为PointF(CenterX - Radius1, CenterY - Radius2)
然后,每个维度中绘图矩形的大小为2 * Radius
。
这里我假设内圆的大小是外圆的一半
中心点设置为PointF(120, 120)
。
绘图在PictureBox的Paint事件中执行。
e.Graphics.SmoothingMode = SmoothingMode.HighQuality;
float Radius1a = 100F;
float Radius1b = 100F;
float Radius2a = Radius1a / 2;
float Radius2b = Radius1b / 2;
PointF CentrePoint = new PointF(120, 120);
PointF Position1 = new PointF(CentrePoint.X - Radius1a, CentrePoint.Y - Radius1b);
PointF Position2 = new PointF(CentrePoint.X - Radius2a, CentrePoint.Y - Radius2b);
RectangleF Rectangle1 = new RectangleF(Position1, new SizeF(Radius1a * 2, Radius1b * 2));
RectangleF Rectangle2 = new RectangleF(Position2, new SizeF(Radius2a * 2, Radius2b * 2));
e.Graphics.DrawEllipse(new Pen(Brushes.Black, 2), Rectangle1);
e.Graphics.DrawEllipse(new Pen(Brushes.Red, 2), Rectangle2);