Exemple #1
0
 public RectangularRoiAdorner(int viewIndex, UIElement adornedElement, Color penColor, Style thumbStyle, Style anchorThumbStyle, CubicRoiAdorner parent)
     : base(adornedElement)
 {
     try
     {
         var doubleVar = Application.Current.FindResource("ControlThumbsTouchAreaLength");
         _thumbSize = (double)doubleVar;
         _parent    = parent;
         _viewIndex = viewIndex;
         AdornerLayer imageAdornerLayer = AdornerLayer.GetAdornerLayer(adornedElement);
         _adornedGrid   = adornedElement as Grid;
         visualChildren = new VisualCollection(this);
         _raster        = new Canvas();
         visualChildren.Add(_raster);
         _penColor                        = penColor;
         _thumbStyle                      = thumbStyle;
         _anchorThumbStyle                = anchorThumbStyle;
         this.IsClipEnabled               = true;
         this.IsHitTestVisible            = true;
         _pathPoints                      = new Point[2];
         AdornedElement.IsVisibleChanged += AdornedElement_IsVisibleChanged;
         imageAdornerLayer.Add(this);
     }
     catch (Exception ex)
     {
         Xvue.MSOT.ViewModels.Log.ViewModelLog.MsotTrace("RectangularRoiAdorner exception: " + ex.Message, this.GetType().ToString());
     }
 }
Exemple #2
0
 private static void P1Changed(DependencyObject source, DependencyPropertyChangedEventArgs e)
 {
     try
     {
         CubicRoiAdorner roi = (source as CubicRoiAdorner);
         roi.setPoint3D(1, roi.P1);
     }
     catch { }
 }