Exemplo n.º 1
0
        // On image toolbar clicked
        private void imageToolBar_ButtonClick(object sender, System.Windows.Forms.ToolBarButtonClickEventArgs e)
        {
            Content doc = dockManager.ActiveDocument;

            if (doc != null)
            {
                if (doc is ImageDoc)
                {
                    ImageDocCommands[] cmd = new ImageDocCommands[]
                    {
                        ImageDocCommands.Clone, ImageDocCommands.Crop,
                        ImageDocCommands.ZoomIn, ImageDocCommands.ZoomOut,
                        ImageDocCommands.ZoomOriginal, ImageDocCommands.FitToSize,
                        ImageDocCommands.Levels, ImageDocCommands.Grayscale,
                        ImageDocCommands.Threshold, ImageDocCommands.Morphology,
                        ImageDocCommands.Convolution, ImageDocCommands.Resize,
                        ImageDocCommands.Rotate, ImageDocCommands.Saturation,
                        ImageDocCommands.Fourier
                    };

                    ((ImageDoc)doc).ExecuteCommand(cmd[e.Button.ImageIndex]);
                }
            }
        }
Exemplo n.º 2
0
 // Execute command
 public void ExecuteCommand(ImageDocCommands cmd)
 {
     switch (cmd)
     {
         case ImageDocCommands.Clone:		// clone the image
             Clone();
             break;
         case ImageDocCommands.Crop:			// crop the image
             Crop();
             break;
         case ImageDocCommands.ZoomIn:		// zoom in
             ZoomIn();
             break;
         case ImageDocCommands.ZoomOut:		// zoom out
             ZoomOut();
             break;
         case ImageDocCommands.ZoomOriginal:	// original size
             zoom = 1;
             UpdateZoom();
             break;
         case ImageDocCommands.FitToSize:	// fit to screen
             FitToScreen();
             break;
         case ImageDocCommands.Levels:		// levels
             Levels();
             break;
         case ImageDocCommands.Grayscale:	// grayscale
             Grayscale();
             break;
         case ImageDocCommands.Threshold:	// threshold
             Threshold();
             break;
         case ImageDocCommands.Morphology:	// morphology
             Morphology();
             break;
         case ImageDocCommands.Convolution:	// convolution
             Convolution();
             break;
         case ImageDocCommands.Resize:		// resize the image
             ResizeImage();
             break;
         case ImageDocCommands.Rotate:		// rotate the image
             RotateImage();
             break;
         case ImageDocCommands.Brightness:	// adjust brightness
             Brightness();
             break;
         case ImageDocCommands.Contrast:		// modify contrast
             Contrast();
             break;
         case ImageDocCommands.Saturation:	// adjust saturation
             Saturation();
             break;
         case ImageDocCommands.Fourier:		// fourier transformation
             ForwardFourierTransformation();
             break;
     }
 }
Exemplo n.º 3
0
        // On image toolbar clicked
        private void imageToolBar_ButtonClick(object sender, System.Windows.Forms.ToolBarButtonClickEventArgs e)
        {
            Content	doc = dockManager.ActiveDocument;

            if (doc != null)
            {
                if (doc is ImageDoc)
                {
                    ImageDocCommands[] cmd = new ImageDocCommands[]
                    {
                        ImageDocCommands.Clone, ImageDocCommands.Crop,
                        ImageDocCommands.ZoomIn, ImageDocCommands.ZoomOut,
                        ImageDocCommands.ZoomOriginal, ImageDocCommands.FitToSize,
                        ImageDocCommands.Levels, ImageDocCommands.Grayscale,
                        ImageDocCommands.Threshold, ImageDocCommands.Morphology,
                        ImageDocCommands.Convolution, ImageDocCommands.Resize,
                        ImageDocCommands.Rotate, ImageDocCommands.Saturation,
                        ImageDocCommands.Fourier
                    };

                    ((ImageDoc) doc).ExecuteCommand(cmd[e.Button.ImageIndex]);
                }
            }
        }