24 lines
726 B
C#
24 lines
726 B
C#
namespace PLCSharp.VVMs.Vision.VisionFlowHandler.Algorithm
|
|
{
|
|
/// <summary>
|
|
/// 清理图像上的 DrawCommands 覆盖层
|
|
/// </summary>
|
|
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;
|
|
}
|
|
}
|
|
} |