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



In This Topic
    DragDropSelectionTool Class
    In This Topic
    Visual tool for dragging and dropping an image region in image viewer.
    Object Model
    DragDropSelectionTool ClassIInteractionController InterfaceImageViewer ClassIInteractionController InterfaceRectangularObjectTransformer Class
    Syntax
    Remarks
    Rectangular region of image in image viewer can be drag-and dropped as follows:
    • place the mouse to the desired position
    • press the action button (VisualTool.ActionButton) and select the "overlay" region by holding the action button, release the action button
    • press and hold the Drag button (DragButton) inside the "drag" region to start dragging; press any mouse button outside the "drag" region for canceling dragging of image region
    • pull the Drag button (DragButton) and drag the "drag" region
    • release the Drag button (DragButton) when "dragged" region is dragged to desired position
    • press the Drop button (DropButton) outside the "drag" region to drop the region; press any mouse button outside the "drag" region for canceling dropping of image region
    If VisualTool.ActionButton, DragButton or DropButton is set to right mouse button, context menu during action can be disabled with the VisualTool.DisableContextMenu property.

    The dragged region is not changed if CTRL key is pressed.
    Example
    This example shows how to programmatically drag and drop a region of image.
    Class DragDropSelectionToolExample
    	' Programmatically drag and drop a region of image.
    	Public Sub ProgrammaticallyDragAndDropImageInViewer(viewer As Vintasoft.Imaging.UI.ImageViewer)
    		' create an instance of the DragDropSelectionTool class
    		Dim dragDropSelectionTool As New Vintasoft.Imaging.UI.VisualTools.DragDropSelectionTool()
    		' set the tool as the current tool of the ImageViewer
    		viewer.VisualTool = dragDropSelectionTool
    		' set the region of interest on image
    		dragDropSelectionTool.Rectangle = New System.Drawing.Rectangle(50, 50, 250, 150)
    		' drag and drop the selected region of image to the specified location within the image
    		dragDropSelectionTool.DragAndDrop(New System.Drawing.Point(200, 250))
    	End Sub
    End Class
    class DragDropSelectionToolExample
    {
        // Programmatically drag and drop a region of image.
        public void ProgrammaticallyDragAndDropImageInViewer(Vintasoft.Imaging.UI.ImageViewer viewer)
        {
            // create an instance of the DragDropSelectionTool class
            Vintasoft.Imaging.UI.VisualTools.DragDropSelectionTool dragDropSelectionTool = 
                new Vintasoft.Imaging.UI.VisualTools.DragDropSelectionTool();
            // set the tool as the current tool of the ImageViewer
            viewer.VisualTool = dragDropSelectionTool;
            // set the region of interest on image
            dragDropSelectionTool.Rectangle = new System.Drawing.Rectangle(50, 50, 250, 150);
            // drag and drop the selected region of image to the specified location within the image
            dragDropSelectionTool.DragAndDrop(new System.Drawing.Point(200, 250));
        }
    }
    Inheritance Hierarchy
    Requirements

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

    See Also