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



In This Topic
    OverlayImageTool Class
    In This Topic
    Visual tool for overlaying an image on a top of image in image viewer.
    Object Model
    OverlayImageTool ClassIInteractionController InterfaceVintasoftImage ClassImageViewer ClassIInteractionController InterfaceRectangularObjectTransformer Class
    Syntax
    Remarks
    Image can be overlaid on a top of image in image viewer as follows:
    select an image to overlay
    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 "overlay" region to start dragging; press any mouse button outside the "overlay" region for canceling dragging of image region
    pull the Drag button (DragButton) and drag the "drag" region
    release the Drag button (DragButton) when "overlay" region is dragged to desired position
    press the Drop button (DropButton) outside the "overlay" region to overlay the image; press any mouse button outside the "overlay" region for canceling overlaying of image
    If VisualTool.ActionButton, DragButton or DropButton 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 overlay an image on a top of image in image viewer.
    Class OverlayImageToolExample
    	' Programmatically overlay an image on a top of image in image viewer.
    	Public Sub ProgrammaticallyOverlayImageInViewer(viewer As Vintasoft.Imaging.UI.ImageViewer)
    		' create an instance of the OverlayImageTool class
    		Dim overlayImageTool1 As New Vintasoft.Imaging.UI.VisualTools.OverlayImageTool()
    		' set the tool as the current tool of the ImageViewer
    		viewer.VisualTool = overlayImageTool1
    		' set an image to overlay
    		overlayImageTool1.Image = New Vintasoft.Imaging.VintasoftImage("d:\image.png")
    		' set the region where image must be overlaid
    		overlayImageTool1.Rectangle = New System.Drawing.Rectangle(50, 50, 250, 150)
    		' overlay an image in image viewer
    		overlayImageTool1.Overlay()
    	End Sub
    End Class
    class OverlayImageToolExample
    {
        // Programmatically overlay an image on a top of image in image viewer.
        public void ProgrammaticallyOverlayImageInViewer(
            Vintasoft.Imaging.UI.ImageViewer viewer)
        {
            // create an instance of the OverlayImageTool class
            Vintasoft.Imaging.UI.VisualTools.OverlayImageTool overlayImageTool1 = 
                new Vintasoft.Imaging.UI.VisualTools.OverlayImageTool();
            // set the tool as the current tool of the ImageViewer
            viewer.VisualTool = overlayImageTool1;
            // set an image to overlay
            overlayImageTool1.Image = new Vintasoft.Imaging.VintasoftImage(@"d:\image.png");
            // set the region where image must be overlaid
            overlayImageTool1.Rectangle = new System.Drawing.Rectangle(50, 50, 250, 150);
            // overlay an image in image viewer
            overlayImageTool1.Overlay();
        }
    }
    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