namespace PLCSharp.VVMs.Vision.VisionFlowHandler.Algorithm { /// /// 清理图像上的 DrawCommands 覆盖层 /// public class ClearDrawHandler : IVisionFlowHandler { public VisionFlowType Type => VisionFlowType.清除绘制; public bool Execute(VisionFunction func, VisionFlow item) { System.Windows.Application.Current.Dispatcher.Invoke(() => { func.DrawCommands.Clear(); func.EditImageEdit?.Remove("DrawOverlay"); func.GlobalModel.GetImageControl(func.ControlName)?.Remove("DrawOverlay"); item.Flow.Done = true; }); return true; } } }