/// <summary>
        /// Creates visual tool action, which allows to enable/disable visual tool <see cref="MagnifierTool"/> in image viewer, and adds action to the toolstrip.
        /// </summary>
        /// <param name="toolStrip">The toolstrip, where actions must be added.</param>
        public static void CreateActions(VisualToolsToolStrip toolStrip)
        {
            // create action, which allows to magnify of image region in image viewer
            MagnifierToolAction magnifierToolAction = new MagnifierToolAction(
                new MagnifierTool(),
                "Magnifier Tool",
                "Magnifier",
                GetIcon("MagnifierTool.png"));

            // add the action to the toolstrip
            toolStrip.AddAction(magnifierToolAction);

            // create action, which allows to zoom an image region in image viewer
            VisualToolAction zoomSelectionToolAction = new VisualToolAction(
                new ZoomSelectionTool(),
                "Zoom Selection Tool",
                "Zoom selection",
                GetIcon("ZoomSelection.png"));

            // add the action to the toolstrip
            toolStrip.AddAction(zoomSelectionToolAction);

            // create action, which allows to zoom an image in image viewer
            VisualToolAction zoomToolAction = new VisualToolAction(
                new ZoomTool(),
                "Zoom Tool",
                "Zoom",
                GetIcon("ZoomTool.png"));

            // add the action to the toolstrip
            toolStrip.AddAction(zoomToolAction);
        }
Beispiel #2
0
        /// <summary>
        /// Creates visual tool actions, which allow to enable/disable visual tools (<see cref="ScrollPages"/> and
        /// the composite visual tool with <see cref="RectangularSelectionTool"/> and <see cref="ScrollPages"/>) in image viewer, and adds actions to the toolstrip.
        /// </summary>
        /// <param name="toolStrip">The toolstrip, where actions must be added.</param>
        public static void CreateActions(VisualToolsToolStrip toolStrip)
        {
            // create action, which allows to scroll pages in image viewer
            VisualToolAction scrollPagesVisualToolAction = new VisualToolAction(
                new ScrollPages(),
                "Scroll Pages",
                "Scroll Pages",
                GetIcon("ScrollPagesTool.png"));

            // add the action to the toolstrip
            toolStrip.AddAction(scrollPagesVisualToolAction);

            // create visual tool, which allows to select rectangular area in image viewer and scroll pages in image viewer
            CompositeVisualTool selectionAndScrollPages = new CompositeVisualTool(
                new RectangularSelectionTool(), new ScrollPages());
            // create action, which allows to select rectangular area in image viewer and scroll pages in image viewer
            VisualToolAction rectangularSelectionAndScrollPagesVisualToolAction = new VisualToolAction(
                selectionAndScrollPages,
                selectionAndScrollPages.Name,
                selectionAndScrollPages.Name,
                GetIcon("SelectionScrollingTool.png"));

            // add the action to the toolstrip
            toolStrip.AddAction(rectangularSelectionAndScrollPagesVisualToolAction);
        }
        /// <summary>
        /// Creates visual tool action, which allows to enable/disable visual tool <see cref="ImageMeasureTool"/> in image viewer, and adds action to the toolstrip.
        /// </summary>
        /// <param name="toolStrip">The toolstrip, where actions must be added.</param>
        public static void CreateActions(VisualToolsToolStrip toolStrip)
        {
#if !REMOVE_ANNOTATION_PLUGIN
            // create action, which allows to measure objects on image in image viewer
            ImageMeasureToolAction imageMeasureToolAction = new ImageMeasureToolAction(
                new ImageMeasureTool(),
                "Image Measure Tool",
                "Image Measure Tool",
                GetIcon("ImageMeasureTool.png"));
            // add the action to the toolstrip
            toolStrip.AddAction(imageMeasureToolAction);
#endif
        }
Beispiel #4
0
        /// <summary>
        /// Creates visual tool actions, which allow to enable/disable visual tools (<see cref="RectangularSelectionTool"/> and <see cref="CustomSelectionTool"/>)
        /// in image viewer, and adds actions to the toolstrip.
        /// </summary>
        /// <param name="toolStrip">The toolstrip, where actions must be added.</param>
        public static void CreateActions(VisualToolsToolStrip toolStrip)
        {
            // create action, which allows to select rectangle on image in image viewer
            RectangularSelectionAction rectangularSelectionAction =
                new RectangularSelectionAction(
                    new RectangularSelectionToolWithCopyPaste(),
                    "Rectangular Selection",
                    "Rectangular Selection",
                    GetIcon("RectangularSelectionTool.png"));

            // add the action to the toolstrip
            toolStrip.AddAction(rectangularSelectionAction);


            // create the custom selection tool
            CustomSelectionTool elipticalSelection = new CustomSelectionTool();

            // set the elliptical selection as the current selection in the custom selection tool
            elipticalSelection.Selection = new EllipticalSelectionRegion();

            // create action, which allows to select the elliptical image region in an image viewer
            CustomSelectionAction ellipticalSelectionAction = new CustomSelectionAction(
                elipticalSelection,
                "Elliptical Selection",
                "Elliptical Selection",
                GetIcon("CustomSelectionToolEllipse.png"));

            // add the action to the toolstrip
            toolStrip.AddAction(ellipticalSelectionAction);


            // the default selection region type
            CustomSelectionRegionTypeAction defaultSelectedRegion = null;
            // create action, which allows to select the custom image region in an image viewer
            CustomSelectionAction customSelectionAction =
                new CustomSelectionAction(
                    new CustomSelectionTool(),
                    "Custom Selection",
                    "Custom Selection",
                    null,
                    CreateSelectionRegionTypeActions(out defaultSelectedRegion));

            // set the default selection region type
            customSelectionAction.SelectRegion(defaultSelectedRegion);
            // add the action to the toolstrip
            toolStrip.AddAction(customSelectionAction);
        }
        /// <summary>
        /// Creates visual tool actions, which allow to enable/disable visual tools (<see cref="CropSelectionTool"/>, <see cref="DragDropSelectionTool"/>,
        /// <see cref="OverlayImageTool"/> and <see cref="PanTool"/>) in image viewer, and adds actions to the toolstrip.
        /// </summary>
        /// <param name="toolStrip">The toolstrip, where actions must be added.</param>
        public static void CreateActions(VisualToolsToolStrip toolStrip)
        {
            // create action, which allows to crop an image in image viewer
            VisualToolAction cropSelectionToolAction = new VisualToolAction(
                new CropSelectionTool(),
                "Crop Selection Tool",
                "Crop selection",
                GetIcon("CropSelectionTool.png"));

            // add the action to the toolstrip
            toolStrip.AddAction(cropSelectionToolAction);

            // create action, which allows to drag-and-drop an image region in image viewer
            VisualToolAction dragDropSelectionToolAction = new VisualToolAction(
                new DragDropSelectionTool(),
                "Drag-n-drop Selection Tool",
                "Drag-n-drop selection",
                GetIcon("DragDropTool.png"));

            // add the action to the toolstrip
            toolStrip.AddAction(dragDropSelectionToolAction);

            // create action, which allows to overlay an image on a top of image in image viewer
            OverlayImageToolAction overlayImageToolAction = new OverlayImageToolAction(
                new OverlayImageTool(),
                "Overlay Image Tool",
                "Overlay Image",
                GetIcon("OverlayTool.png"));

            // add the action to the toolstrip
            toolStrip.AddAction(overlayImageToolAction);

            // create action, which allows to pan an image in image viewer
            VisualToolAction panToolAction = new VisualToolAction(
                new PanTool(),
                "Pan Tool",
                "Pan",
                GetIcon("PanTool.png"));

            // add the action to the toolstrip
            toolStrip.AddAction(panToolAction);
        }