Exemplo n.º 1
0
        private void UnregisterMouseEvents()
        {
            PanZoom_MenuItem.Icon      = null;
            Annotation_MenuItem.Icon   = null;
            Measurements_MenuItem.Icon = null;
            Magnifier_MenuItem.Icon    = null;
            AOI_MenuItem.Icon          = null;

            MainXRayView.PanAndZoomControl.MouseEventsEnabled = false;

            AnnotationAdorner annotationAdorner = (MainXRayView.AdornerLayerManager[AdornerLayerManager.ANNOTATION_ADORNER] as AnnotationAdorner);

            annotationAdorner.Enabled = false;

            MeasureAdorner measureAdorner = (MainXRayView.AdornerLayerManager[AdornerLayerManager.MEASUREMENT_ADORNER] as MeasureAdorner);

            measureAdorner.Enabled = false;

            AOIAdorner aoiAdorner = (MainXRayView.AdornerLayerManager[AdornerLayerManager.AOI_ADORNER] as AOIAdorner);

            aoiAdorner.Enabled = false;

            //MainXRayView.adonerImageObject.AOIButton_Clicked(m_ViewObject, false);

            MainXRayView.Magnifier_Panel.Effect   = null;
            m_MagnifierSettings.IsMagniferEnabled = false;
            MainXRayView.MainImage.Cursor         = Cursors.Arrow;

            Annotation_Rectangle.Visibility   = Visibility.Collapsed;
            Annotation_Ellipse.Visibility     = Visibility.Collapsed;
            PanAndZoom_Normal.Visibility      = System.Windows.Visibility.Collapsed;
            PanAndZoom_FitToScreen.Visibility = System.Windows.Visibility.Collapsed;
            Options_Menu_Seperator.Visibility = Visibility.Collapsed;
        }
Exemplo n.º 2
0
        private void OnLoaded(object sender, RoutedEventArgs e)
        {
            this.Loaded -= new RoutedEventHandler(OnLoaded);

            MeasureAdorner measureAdorner = new MeasureAdorner(MainImage, PanAndZoomControl);

            measureAdorner.SamplingSpace = m_ViewObject.SamplingSpace;
            measureAdorner.SamplingSpeed = m_ViewObject.SamplingSpeed;
            _AdornerLayerManager.Add(AdornerLayerManager.MEASUREMENT_ADORNER, measureAdorner);

            AnnotationAdorner annotationAdorner = new AnnotationAdorner(MainImage, PanAndZoomControl);

            _AdornerLayerManager.Add(AdornerLayerManager.ANNOTATION_ADORNER, annotationAdorner);

            if (m_ViewObject.Annotations != null && m_ViewObject.Annotations.Count > 0)
            {
                var annotAdorner = (_AdornerLayerManager.GetAdorner(AdornerLayerManager.ANNOTATION_ADORNER) as AnnotationAdorner);
                annotAdorner.SetCanCreateAnnotation(CanCreateNewAnnot);
                if (annotAdorner != null)
                {
                    foreach (AnnotationInfo info in m_ViewObject.Annotations)
                    {
                        annotAdorner.AddAnnotationInfo(info, true);
                    }
                }
            }
            _AdornerLayerManager.Hide(AdornerLayerManager.ANNOTATION_ADORNER);
            _AdornerLayerManager.Show(AdornerLayerManager.ANNOTATION_ADORNER);

            AOIAdorner aoiAdorner = new AOIAdorner(MainImage, PanAndZoomControl);

            aoiAdorner.AlgServerRequestEvent += new AlgServerRequestEventHandler(AoiAdorner_AlgServerRequestEvent);
            _AdornerLayerManager.Add(AdornerLayerManager.AOI_ADORNER, aoiAdorner);
        }
Exemplo n.º 3
0
        public void AOI_MenuItem_Click(object sender, RoutedEventArgs e)
        {
            UnregisterMouseEvents();

            AOI_Show_MenuItem_Click(sender, e);
            AOIAdorner aoiAdorner = (MainXRayView.AdornerLayerManager[AdornerLayerManager.AOI_ADORNER] as AOIAdorner);

            aoiAdorner.Enabled = true;
            aoiAdorner.Setup(m_ViewObject);

            Image image = new Image();

            image.Source      = new BitmapImage(new Uri(@"/L3.Cargo.Workstation.Plugins.XRayImageBase;component/Resources/Icons/checkmark.gif", UriKind.Relative));
            AOI_MenuItem.Icon = image;

            MainXRayView.MainImage.Cursor = Cursors.Cross;
        }