VintaSoft Imaging .NET SDK 12.4: Documentation for .NET developer
Vintasoft.Imaging.UI.VisualTools Namespace / OverlayImageTool Class
Members Object Syntax Remarks Example Hierarchy Requirements SeeAlso
In This Topic
    OverlayImageTool Class
    In This Topic
    Visual tool for overlaying an image on a top of image in image viewer.
    Object Model
    VintasoftImage IInteractionController IInteractionController RectangularObjectTransformer IObjectClipboard ImageViewer OverlayImageTool
    Syntax
    'Declaration
    
    Public Class OverlayImageTool
       Inherits RectangularSelectionTool
    
    
    public class OverlayImageTool : RectangularSelectionTool
    
    
    public __gc class OverlayImageTool : public RectangularSelectionTool*
    
    
    public ref class OverlayImageTool : public RectangularSelectionTool^
    
    
    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 (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 ActionButton, DragButton or DropButton is set to right mouse button, context menu during action can be disabled with the DisableContextMenu property.

    Example

    This C#/VB.NET code 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: .NET 8; .NET 7; .NET 6; .NET Framework 4.8, 4.7, 4.6, 4.5, 4.0, 3.5

    See Also