VintaSoft Imaging .NET SDK 15.1: Документация для .NET разработчика
Vintasoft.Imaging.Wpf.UI.VisualTools Namespace / WpfImageViewerProcessingTool Class
Члены типа Объект Синтаксис Example Иерархия Требования Смотрите также
В этом разделе
Класс WpfImageViewerProcessingTool
В этом разделе
Визуальный инструмент для обработки прямоугольной области в просмотрщике изображений.
Объектная модель
ProcessingCommandBase WpfImageViewer WpfImageViewerProcessingTool
Синтаксис
'Declaration

<ToolboxItemAttribute("ToolboxItemType = null", "ToolboxItemTypeName = ")>
<DesignTimeVisibleAttribute("Visible = False")>
<DefaultPropertyAttribute("Content")>
<ContentPropertyAttribute("Content")>
<LocalizabilityAttribute(None)>
<StyleTypedPropertyAttribute("Property = FocusVisualStyle", "StyleTargetType = System.Windows.Controls.Control")>
<XmlLangPropertyAttribute("Name = Language")>
<UsableDuringInitializationAttribute("Usable = True")>
<RuntimeNamePropertyAttribute("Name = Name")>
<UidPropertyAttribute()>
<TypeDescriptionProviderAttribute("TypeName = MS.Internal.ComponentModel.DependencyObjectProvider")>
<NameScopePropertyAttribute("Name = NameScope", "Type = System.Windows.NameScope")>
Public Class WpfImageViewerProcessingTool
   Inherits WpfVisualTool

[ToolboxItem("ToolboxItemType = null", "ToolboxItemTypeName = ")]
[DesignTimeVisible("Visible = False")]
[DefaultProperty("Content")]
[ContentProperty("Content")]
[Localizability(None)]
[StyleTypedProperty("Property = FocusVisualStyle", "StyleTargetType = System.Windows.Controls.Control")]
[XmlLangProperty("Name = Language")]
[UsableDuringInitialization("Usable = True")]
[RuntimeNameProperty("Name = Name")]
[UidProperty()]
[TypeDescriptionProvider("TypeName = MS.Internal.ComponentModel.DependencyObjectProvider")]
[NameScopeProperty("Name = NameScope", "Type = System.Windows.NameScope")]
public class WpfImageViewerProcessingTool : WpfVisualTool

Пример

Вот C#/VB.NET код, который демонстрирует, как добавить визуальный инструмент, который изменяет яркость видимой области просмотрщика изображений, в просмотрщик изображений.


''' <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.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="imageBrightness">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;
}

Иерархия наследования

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

Требования

Целевые платформы: .NET 10; .NET 9; .NET 8; .NET 7; .NET 6; .NET Framework 4.8, 4.7, 4.6, 4.5, 4.0, 3.5

Смотрите также