private void RemovePinwheelGraphic()
        {
            if (_currentPinwheelGraphic != null)
            {
                IPresentationImage image = _currentPinwheelGraphic.ParentPresentationImage;
                ((CompositeGraphic)_currentPinwheelGraphic.ParentGraphic).Graphics.Remove(_currentPinwheelGraphic);
                image.Draw();

                _currentPinwheelGraphic.Dispose();
            }

            _currentPinwheelGraphic = null;
        }
        private void AddPinwheelGraphic()
        {
            IPresentationImage selectedImage = base.SelectedPresentationImage;

            if (selectedImage == null)
            {
                return;
            }

            if (!base.IsMprImage(selectedImage))
            {
                return;
            }

            MprDisplaySet displaySet = (MprDisplaySet)selectedImage.ParentDisplaySet;

            if (displaySet.Identifier == MprDisplaySetIdentifier.Oblique)
            {
                return;
            }

            IOverlayGraphicsProvider overlayProvider      = selectedImage as IOverlayGraphicsProvider;
            IImageGraphicProvider    imageGraphicProvider = selectedImage as IImageGraphicProvider;

            if (overlayProvider != null && imageGraphicProvider != null)
            {
                _currentPinwheelGraphic = new PinwheelGraphic();

                int width  = imageGraphicProvider.ImageGraphic.Columns;
                int height = imageGraphicProvider.ImageGraphic.Rows;

                overlayProvider.OverlayGraphics.Add(_currentPinwheelGraphic);
                _currentPinwheelGraphic.CoordinateSystem = CoordinateSystem.Source;
                _currentPinwheelGraphic.Rotation         = GetRotationAngle();
                _currentPinwheelGraphic.Draw();
            }
        }
Example #3
0
		private void RemovePinwheelGraphic()
		{
			if (_currentPinwheelGraphic != null)
			{
				IPresentationImage image = _currentPinwheelGraphic.ParentPresentationImage;
				((CompositeGraphic)_currentPinwheelGraphic.ParentGraphic).Graphics.Remove(_currentPinwheelGraphic);
				image.Draw();

				_currentPinwheelGraphic.Dispose();
			}

			_currentPinwheelGraphic = null;
		}
Example #4
0
		private void AddPinwheelGraphic()
		{
			IPresentationImage selectedImage = base.SelectedPresentationImage;
			if (selectedImage == null)
				return;

			if (!base.IsMprImage(selectedImage))
				return;

			MprDisplaySet displaySet = (MprDisplaySet)selectedImage.ParentDisplaySet;
			if (displaySet.Identifier == MprDisplaySetIdentifier.Oblique)
				return;

			IOverlayGraphicsProvider overlayProvider = selectedImage as IOverlayGraphicsProvider;
			IImageGraphicProvider imageGraphicProvider = selectedImage as IImageGraphicProvider;
			
			if (overlayProvider != null && imageGraphicProvider != null)
			{
				_currentPinwheelGraphic = new PinwheelGraphic();

				int width = imageGraphicProvider.ImageGraphic.Columns;
				int height = imageGraphicProvider.ImageGraphic.Rows;

				overlayProvider.OverlayGraphics.Add(_currentPinwheelGraphic);
				_currentPinwheelGraphic.CoordinateSystem = CoordinateSystem.Source;
				_currentPinwheelGraphic.Rotation = GetRotationAngle();
				_currentPinwheelGraphic.Draw();
			}
		}