【发布时间】:2019-08-02 05:39:25
【问题描述】:
我正在尝试使用对象的矩形 COG 对 blob 进行编号。但是矩形是椭圆形的,因此我没有按正确的顺序得到它。
Font annotationFont = new Font("Verdana", 12, FontStyle.Bold);
Pen annotationPen = new Pen(Color.FromName("White"), 2.5f);
Graphics g = imageBoxMain.CreateGraphics();
for (int i = 0; i < totalrectcount; i++)
{
Rectangle rect = new Rectangle(arrayX[i] /* blobid[i].name.Length * 6)*/, imageBoxMain.Image.Height - arrayminY[i]- 6, 100, 20);
g.DrawString(Convert.ToString(i + 1), annotationFont, annotationPen.Brush, new System.Drawing.Point(rect.X, rect.Y));
}
这就是我得到的:
我希望从左到右标记矩形。
【问题讨论】:
标签: c# arrays .net emgucv drawrectangle