예제 #1
0
        private void AddAnnotationRectangle(MedicalViewerSubCell subCell)
        {
            AnnRectangleObject rect = new AnnRectangleObject();

            rect.IsVisible = false;
            rect.Stroke    = AnnStroke.Create(AnnSolidColorBrush.Create("Red"), LeadLengthD.Create(5));
            subCell.AnnotationContainer.Children.Add(rect);
        }
예제 #2
0
        private void thicknessPropertyInfo_ValueChanged(object oldValue, object newValue)
        {
            _annStroke.StrokeThickness = LeadLengthD.Create((double)newValue);

            if (OnValueChanged != null)
            {
                OnValueChanged(oldValue, newValue);
            }
        }
예제 #3
0
        void tickMarksLengthInfo_ValueChanged(object oldValue, object newValue)
        {
            LeadLengthD newTickMarksLength = LeadLengthD.Create((double)newValue);

            _polyRulerObj.TickMarksLength = newTickMarksLength;

            if (OnPropertyChanged != null)
            {
                OnPropertyChanged("TickMarksLength", newTickMarksLength);
            }
        }
예제 #4
0
        void gaugeLengthInfo_ValueChanged(object oldValue, object newValue)
        {
            LeadLengthD newGaugeLength = LeadLengthD.Create((double)newValue);

            _polyRulerObj.GaugeLength = newGaugeLength;

            if (OnPropertyChanged != null)
            {
                OnPropertyChanged("GaugeLength", newGaugeLength);
            }
        }
예제 #5
0
        private void AddFusionEditRectangle(MedicalViewerSubCell subCell)
        {
            AnnRectangleObject rect = new AnnRectangleObject();

            rect.IsVisible = false;
            rect.Stroke    = AnnStroke.Create(AnnSolidColorBrush.Create("Red"), LeadLengthD.Create(5));
            subCell.AnnotationContainer.Children.Add(rect);
            //rect.RotateGripper = new LeadLengthD(1);

            _cell.AnnotationPrecedency = true;
        }
예제 #6
0
        void scEngine_CaptureInformation(object sender, ScreenCaptureInformationEventArgs e)
        {
            e.Image.XResolution = e.Image.YResolution = 300;
            AnnAutomationObject customAnn   = annAutomationManager.FindObjectById(AnnObject.StampObjectId);
            AnnStampObject      customStamp = (AnnStampObject)customAnn.ObjectTemplate;

            customStamp.Text = " ";

            customStamp.Fill    = null;
            customStamp.Stroke  = AnnStroke.Create(AnnSolidColorBrush.Create("Red"), LeadLengthD.Create(0));;
            customStamp.Picture = new AnnPicture(RasterImageConverter.ConvertToImage(e.Image, ConvertToImageOptions.None));
        }
예제 #7
0
        private void ApplyCalibrate()
        {
            if (_isPixelUnit)
            {
                _polyRulerObject.MeasurementUnit = AnnUnit.SmartEnglish;
            }

            // the method _polyRulerObject.GetRulerLength() , gets the ruler length in AnnUnit.Unit so we need to convert it to current _polyRulerObject.MeasurementUnit with no calibration ratio
            LeadLengthD lengthInUnits = _polyRulerObject.GetRulerLength(1);

            double sourceLength = AnnUnitConverter.Convert(lengthInUnits.Value, AnnUnit.Unit, _polyRulerObject.MeasurementUnit);

            double destLength = 1;

            // check if the entered value is Number
            if (!double.TryParse(_txtRulerLength.Text, out destLength))
            {
                throw new Exception("Invalid Ruler Length Value");
            }

            if (sourceLength != 0 && destLength != 0)
            {
                AnnUnit destUnit = (AnnUnit)Enum.Parse(typeof(AnnUnit), _comboMesurementUnit.SelectedItem.ToString());

                if (_cboxApplyToAllRulers.Checked)
                {
                    _mapper.Calibrate(LeadLengthD.Create(sourceLength), _polyRulerObject.MeasurementUnit, LeadLengthD.Create(destLength), destUnit);

                    AnnAutomationManager manager = _automation.Manager;

                    //update all exisiting rulers to have the new calibration measurement unit
                    foreach (AnnObject annObject in _automation.Container.Children)
                    {
                        AnnPolyRulerObject polyRuler = annObject as AnnPolyRulerObject;
                        if (polyRuler != null)
                        {
                            polyRuler.MeasurementUnit = destUnit;
                        }
                    }
                }
                else
                {
                    _polyRulerObject.Calibrate(LeadLengthD.Create(sourceLength), _polyRulerObject.MeasurementUnit, LeadLengthD.Create(destLength), destUnit);
                }

                _polyRulerObject.MeasurementUnit = destUnit;
            }

            if (_isPixelUnit)
            {
                _polyRulerObject.MeasurementUnit = AnnUnit.Pixel;
            }
        }
예제 #8
0
        public override void Deserialize(AnnDeserializeOptions options, XmlNode element, XmlDocument document)
        {
            base.Deserialize(options, element, document);

            string data = string.Empty;

            XmlElement  xmlElement = element as XmlElement;
            XmlNodeList nodeList   = xmlElement.GetElementsByTagName("CenterPointRadius");

            foreach (XmlNode childNode in nodeList)
            {
                if (childNode != null && (childNode.ParentNode == element))
                {
                    data = childNode.FirstChild.Value.Trim();
                    break;
                }
            }

            _centerPointRadius = LeadLengthD.Create(double.Parse(data));
        }
예제 #9
0
        void strokePropertyInfo_ValueChanged(object oldValue, object newValue)
        {
            string    color     = newValue as string;
            AnnStroke newStroke = null;

            newStroke = _annObject.Stroke.Clone();
            if (color == null)
            {
                newStroke.StrokeThickness = LeadLengthD.Create(double.Parse(newValue.ToString()));
            }
            else
            {
                newStroke.Stroke = AnnSolidColorBrush.Create(color);
            }

            _annObject.Stroke = newStroke.Clone();

            if (OnPropertyChanged != null)
            {
                OnPropertyChanged("Stroke", newStroke);
            }
        }
예제 #10
0
        private void _btnApply_Click(object sender, EventArgs e)
        {
            if (_chkUsePen.Checked)
            {
                GetColor(_lblPenColor.BackColor);
                _annObj.Stroke = AnnStroke.Create(AnnSolidColorBrush.Create(GetColor(_lblPenColor.BackColor)), LeadLengthD.Create((double)_penWidth.Value));//, AnnUnit.Pixel));
                if (_annObj is AnnPolyRulerObject)
                {
                    AnnPolyRulerObject polyRulerObject = (AnnPolyRulerObject)_annObj;

                    polyRulerObject.TickMarksStroke = _annObj.Stroke;
                }
            }
            else
            {
                _annObj.Stroke = null;
            }

            if (_chkUseBrush.Checked)
            {
                if (_annObj is AnnHiliteObject)
                {
                    ((AnnHiliteObject)_annObj).HiliteColor = GetColor(_lblBrushColor.BackColor);
                }
                else
                {
                    _annObj.Fill = AnnSolidColorBrush.Create(GetColor(_lblBrushColor.BackColor));
                }
            }
            else
            {
                _annObj.Fill = null;
            }

            if (_annFont != null)
            {
                if (!_annFont.Equals(_annObj.Font))
                {
                    _annObj.Font = _annFont;
                }

                AnnTextObject textObject = (AnnTextObject)_annObj;

                textObject.TextForeground = AnnSolidColorBrush.Create(GetColor(_fontColor));
            }

            _cell.RefreshAnnotation();
        }
예제 #11
0
        private AnnThumbStyle CreateRotateGripperThumbStyle()
        {
            AnnThumbStyle rotateGripperThumbStyle = new AnnEllipseThumbStyle();

            double thumbSize = ThumbSize;

            rotateGripperThumbStyle.Size   = LeadSizeD.Create(thumbSize, thumbSize);
            rotateGripperThumbStyle.Stroke = AnnStroke.Create(AnnSolidColorBrush.Create("black"), LeadLengthD.Create(1));

            rotateGripperThumbStyle.Fill = AnnSolidColorBrush.Create("lightgreen");

            return(rotateGripperThumbStyle);
        }
예제 #12
0
        private AnnThumbStyle CreateLocationThumbStyle()
        {
            AnnThumbStyle locationThumbStyle = new AnnRectangleThumbStyle();

            double thumbSize = ThumbSize;

            locationThumbStyle.Size   = LeadSizeD.Create(thumbSize, thumbSize);
            locationThumbStyle.Stroke = AnnStroke.Create(AnnSolidColorBrush.Create("black"), LeadLengthD.Create(1));

            locationThumbStyle.Fill = AnnSolidColorBrush.Create("lightblue");

            return(locationThumbStyle);
        }
예제 #13
0
 static AnnNorbergDrawer()
 {
     _objectTemplate = new AnnRectangleObject();
     _objectTemplate.Stroke.Stroke          = AnnSolidColorBrush.Create("black");
     _objectTemplate.Stroke.StrokeThickness = LeadLengthD.Create(2);
 }