测量工具标号:各类测量标签显示序号,删除后自动重编号

This commit is contained in:
李伟
2026-04-24 16:32:21 +08:00
parent 5900907236
commit b593805f11
5 changed files with 44 additions and 5 deletions
@@ -20,6 +20,7 @@ namespace XP.ImageProcessing.RoiControl.Models
public Point L1 { get; set; }
public Point L2 { get; set; }
public Point P { get; set; }
public int Index { get; set; }
public double Distance
{
@@ -85,7 +86,7 @@ namespace XP.ImageProcessing.RoiControl.Models
FootDot.Visibility = Visibility.Visible;
// 标签
Label.Text = distanceText ?? $"{Distance:F2} px";
Label.Text = (Index > 0 ? $"#{Index} " : "") + (distanceText ?? $"{Distance:F2} px");
Canvas.SetLeft(Label, (P.X + foot.X) / 2 + 8);
Canvas.SetTop(Label, (P.Y + foot.Y) / 2 - 18);
Label.Visibility = Visibility.Visible;