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



In This Topic
    WpfImageViewerProcessingTool Class
    In This Topic
    Visual tool for processing of rectangular area in an image viewer.
    Object Model
    WpfImageViewerProcessingTool ClassWpfImageViewer ClassProcessingCommandBase Class
    Syntax
    'Declaration
     
    Public Class WpfImageViewerProcessingTool 
       Inherits WpfVisualTool
    public class WpfImageViewerProcessingTool : WpfVisualTool 
    public __gc class WpfImageViewerProcessingTool : public WpfVisualTool 
    public ref class WpfImageViewerProcessingTool : public WpfVisualTool 
    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="brightness">The image brightness value in percents. Valid values are from -100 to 100.</param>
    Public Sub AddVisualToolForProcessingVisibleAreaInImageViewer(imageViewer As Vintasoft.Imaging.Wpf.UI.WpfImageViewer, imageBrightness As Integer)
    	' create command for changing of image brightness
    	Dim changeBrightness As New Vintasoft.Imaging.ImageProcessing.Color.ChangeBrightnessCommand()
    	' set the command parameters
    	changeBrightness.Brightness = imageBrightness
                
    	' create an instance of the ImageViewerProcessingTool class
    	Dim viewerProcessingTool As New Vintasoft.Imaging.Wpf.UI.VisualTools.WpfImageViewerProcessingTool()
    	' specify that visual tool must use the command for processing visible area in image viewer
    	viewerProcessingTool.ProcessingCommand = changeBrightness
                
    	' set the tool as the current tool of the ImageViewer
    	imageViewer.VisualTool = viewerProcessingTool
    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="brightness">The image brightness value in percents. Valid values are from -100 to 100.</param>
    public void AddVisualToolForProcessingVisibleAreaInImageViewer(
        Vintasoft.Imaging.Wpf.UI.WpfImageViewer imageViewer, int imageBrightness)
    {
        // create command for changing of image brightness
        Vintasoft.Imaging.ImageProcessing.Color.ChangeBrightnessCommand changeBrightness =
            new Vintasoft.Imaging.ImageProcessing.Color.ChangeBrightnessCommand();
        // set the command parameters
        changeBrightness.Brightness = imageBrightness;
                
        // create an instance of the ImageViewerProcessingTool class
        Vintasoft.Imaging.Wpf.UI.VisualTools.WpfImageViewerProcessingTool viewerProcessingTool =
            new Vintasoft.Imaging.Wpf.UI.VisualTools.WpfImageViewerProcessingTool();
        // specify that visual tool must use the command for processing visible area in image viewer
        viewerProcessingTool.ProcessingCommand = changeBrightness;
                
        // set the tool as the current tool of the ImageViewer
        imageViewer.VisualTool = viewerProcessingTool;
    }
    Inheritance Hierarchy

    System.Object
       System.Windows.Threading.DispatcherObject
          System.Windows.DependencyObject
             System.Windows.Media.Visual
                System.Windows.UIElement
                   System.Windows.FrameworkElement
                      System.Windows.Controls.Control
                         System.Windows.Controls.ContentControl
                            Vintasoft.Imaging.Wpf.UI.VisualTools.WpfVisualTool
                               Vintasoft.Imaging.Wpf.UI.VisualTools.WpfImageViewerProcessingTool

    Requirements

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

    See Also