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



In This Topic
    ImageViewerProcessingTool Class
    In This Topic
    Visual tool for processing of rectangular area in image viewer.
    Object Model
    ImageViewerProcessingTool ClassImageViewer ClassProcessingCommandBase Class
    Syntax
    'Declaration
     
    Public Class ImageViewerProcessingTool 
       Inherits VisualTool
    public class ImageViewerProcessingTool : VisualTool 
    public __gc class ImageViewerProcessingTool : public VisualTool 
    public ref class ImageViewerProcessingTool : public VisualTool 
    Remarks
    This visual tool is faster than ImageProcessingTool because this tool processes only image region, which is visible in image viewer, and ImageProcessingTool always processes the whole image loaded in image viewer.
    Example
    This example shows how to add the visual tool, which changes brightness of visible area of image viewer, to the image viewer.
    ''' <summary>
    ''' Adds the visual tool, which changes brightness of visible area of image viewer, to the image viewer.
    ''' </summary>
    ''' <param name="imageViewer">The image viewer.</param>
    ''' <param name="imageBrightness">The image brightness value in percents. Valid values are from -100 to 100.</param>
    Public Sub AddVisualToolForProcessingVisibleAreaInImageViewer(imageViewer As Vintasoft.Imaging.UI.ImageViewer, imageBrightness As Integer)
    	' create command for changing of image brightness
    	Dim changeBrightnessCommand As New Vintasoft.Imaging.ImageProcessing.Color.ChangeBrightnessCommand()
    	' set the command parameters
    	changeBrightnessCommand.Brightness = imageBrightness
                
    	' create an instance of the ImageViewerProcessingTool class
    	Dim imageViewerProcessingTool As New Vintasoft.Imaging.UI.VisualTools.ImageViewerProcessingTool()
    	' specify that visual tool must use the command for processing visible area in image viewer
    	imageViewerProcessingTool.ProcessingCommand = changeBrightnessCommand
                
    	' set the tool as the current tool of the ImageViewer
    	imageViewer.VisualTool = imageViewerProcessingTool
    End Sub
    /// <summary>
    /// Adds the visual tool, which changes brightness of visible area of image viewer, to the image viewer.
    /// </summary>
    /// <param name="imageViewer">The image viewer.</param>
    /// <param name="imageBrightness">The image brightness value in percents. Valid values are from -100 to 100.</param>
    public void AddVisualToolForProcessingVisibleAreaInImageViewer(
        Vintasoft.Imaging.UI.ImageViewer imageViewer,
        int imageBrightness)
    {
        // create command for changing of image brightness
        Vintasoft.Imaging.ImageProcessing.Color.ChangeBrightnessCommand changeBrightnessCommand = 
            new Vintasoft.Imaging.ImageProcessing.Color.ChangeBrightnessCommand();
        // set the command parameters
        changeBrightnessCommand.Brightness = imageBrightness;
                
        // create an instance of the ImageViewerProcessingTool class
        Vintasoft.Imaging.UI.VisualTools.ImageViewerProcessingTool imageViewerProcessingTool =
            new Vintasoft.Imaging.UI.VisualTools.ImageViewerProcessingTool();
        // specify that visual tool must use the command for processing visible area in image viewer
        imageViewerProcessingTool.ProcessingCommand = changeBrightnessCommand;
                
        // set the tool as the current tool of the ImageViewer
        imageViewer.VisualTool = imageViewerProcessingTool;
    }
    Inheritance Hierarchy

    System.Object
       Vintasoft.Imaging.UI.VisualTools.VisualTool
          Vintasoft.Imaging.UI.VisualTools.ImageViewerProcessingTool

    Requirements

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

    See Also