ImageToolBlockEdit.xaml.cs 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. using Cognex.VisionPro;
  2. using Cognex.VisionPro.ToolBlock;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Linq;
  6. using System.Text;
  7. using System.Threading.Tasks;
  8. using System.Windows;
  9. using System.Windows.Controls;
  10. using System.Windows.Data;
  11. using System.Windows.Documents;
  12. using System.Windows.Input;
  13. using System.Windows.Media;
  14. using System.Windows.Media.Imaging;
  15. using System.Windows.Navigation;
  16. using System.Windows.Shapes;
  17. namespace Plugins.Vpp.Views
  18. {
  19. /// <summary>
  20. /// ImageToolBlockEdit.xaml 的交互逻辑
  21. /// </summary>
  22. public partial class ImageToolBlockEdit : UserControl
  23. {
  24. public CogAcqFifoEditV2 CogToolBlockEdit
  25. {
  26. get => ICogAcqFifoEditV2;
  27. set => ICogAcqFifoEditV2 = value;
  28. }
  29. public ImageToolBlockEdit()
  30. {
  31. InitializeComponent();
  32. Init();
  33. }
  34. public void Init()
  35. {
  36. try
  37. {
  38. var type = ICogAcqFifoEditV2.GetType();
  39. var property = type.GetProperty("DoubleBuffered", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic);
  40. if (property != null)
  41. {
  42. property.SetValue(ICogAcqFifoEditV2, true, null);
  43. }
  44. WFH.Child = ICogAcqFifoEditV2;
  45. WFH.Child = ICogAcqFifoEditV2;
  46. }
  47. catch (Exception ex)
  48. {
  49. }
  50. }
  51. }
  52. }