VintaSoft Imaging .NET SDK v8.7
Vintasoft.Imaging.UI.VisualTools Namespace / RectangularSelectionToolWithCopyPaste Class
Members Example



In This Topic
    RectangularSelectionToolWithCopyPaste Class
    In This Topic
    Visual tool for selecting a rectangular image region in image viewer. Selected image region can be copied into clipboard. Selected image region can be replaced by image from clipboard.
    Object Model
    RectangularSelectionToolWithCopyPaste ClassIInteractionController InterfaceIObjectClipboard InterfaceImageViewer ClassIInteractionController InterfaceRectangularObjectTransformer Class
    Syntax
    Remarks
    RectangularSelectionToolWithCopyPaste allows to:
    • Select a rectangular region of image
    • Copy selected region of image to clipboard or get selected region as a Bitmap object
    • Paste image from clipboard into selected region of image


    Rectangular region of image in image viewer can be selected as follows:
    • place the mouse to the desired position
    • press the action button (VisualTool.ActionButton) and select the region by holding the action button
    • release the action button to stop the selection of region

    Selected region of image can be copied to clipboard by pressing Ctrl+C button.
    Selected region of image can be replaced by image from clipboard by pressing Ctrl+V button.


    Rectangular region of image in image viewer can be programmatically selected with System.Drawing.Rectangle property.
    Selected region of image can be programmatically copied to clipboard using CopyToClipboard.
    Selected region of image can be programmatically replaced by image from clipboard using PasteFromClipboard.


    Rectangular region of image in image viewer can be programmatically selected with System.Drawing.Rectangle property.

    If VisualTool.ActionButton is set to right mouse button, context menu during action can be disabled with the VisualTool.DisableContextMenu property.
    Example
    This example shows how to programmatically copy part of image to clipboard.
    Class SelectionExample
    	' Programmatically copy part of image to clipboard.
    	Public Sub RunExample(viewer As Vintasoft.Imaging.UI.ImageViewer)
    		' create an instance of the RectangularSelectionToolWithCopyPaste class
    		Dim selection As New Vintasoft.Imaging.UI.VisualTools.RectangularSelectionToolWithCopyPaste()
    		' set the tool as the current tool of the ImageViewer
    		viewer.VisualTool = selection
    		' set the region of interest on image
    		selection.Rectangle = New System.Drawing.Rectangle(50, 50, 250, 150)
    		' copy selected region of image to clipboard
    		selection.CopyToClipboard()
    	End Sub
    End Class
    class SelectionExample
    {
        // Programmatically copy part of image to clipboard.
        public void RunExample(Vintasoft.Imaging.UI.ImageViewer viewer)
        {
            // create an instance of the RectangularSelectionToolWithCopyPaste class
            Vintasoft.Imaging.UI.VisualTools.RectangularSelectionToolWithCopyPaste selection = 
                new Vintasoft.Imaging.UI.VisualTools.RectangularSelectionToolWithCopyPaste();
            // set the tool as the current tool of the ImageViewer
            viewer.VisualTool = selection;
            // set the region of interest on image
            selection.Rectangle = new System.Drawing.Rectangle(50, 50, 250, 150);
            // copy selected region of image to clipboard
            selection.CopyToClipboard();
        }
    }
    Inheritance Hierarchy

    System.Object
       Vintasoft.Imaging.UI.VisualTools.VisualTool
          Vintasoft.Imaging.UI.VisualTools.UserInteraction.UserInteractionVisualTool
             Vintasoft.Imaging.UI.VisualTools.RectangularSelectionTool
                Vintasoft.Imaging.UI.VisualTools.RectangularSelectionToolWithCopyPaste

    Requirements

    Target Platforms: Windows 10, Windows 8, Windows 7, Windows Vista, Windows XP, Windows Server 2012, Windows Server 2008, Windows Server 2003

    See Also