VintaSoft Imaging .NET SDK 14.0: Документация для .NET разработчика
Vintasoft.Imaging.Wpf.UI.VisualTools Namespace / WpfTextOverlayTool Class
Члены типа Объект Синтаксис Example Иерархия Требования Смотрите также
В этом разделе
    Класс WpfTextOverlayTool
    В этом разделе
    Визуальный инструмент для отображения статических текстовых графических объектов в просмотрщике изображений.
    Объектная модель
    WpfTextOverlayCollection IObjectClipboard IWpfInteractionController WpfImageViewer WpfTextOverlayTool
    Синтаксис
    '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 WpfTextOverlayTool
       Inherits Vintasoft.Imaging.Wpf.UI.VisualTools.GraphicObjects.WpfGraphicObjectTool
    
    
    [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 WpfTextOverlayTool : Vintasoft.Imaging.Wpf.UI.VisualTools.GraphicObjects.WpfGraphicObjectTool
    
    
    [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 __gc class WpfTextOverlayTool : public Vintasoft.Imaging.Wpf.UI.VisualTools.GraphicObjects.WpfGraphicObjectTool*
    
    
    [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 ref class WpfTextOverlayTool : public Vintasoft.Imaging.Wpf.UI.VisualTools.GraphicObjects.WpfGraphicObjectTool^
    
    
    Пример

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

    
    ''' <summary>
    ''' Shows the static text in image viewer.
    ''' </summary>
    ''' <param name="viewer">An image viewer.</param>
    Public Shared Sub ShowStaticTextExample(viewer As Vintasoft.Imaging.Wpf.UI.WpfImageViewer)
        ' create the text overlay visual tool
        Dim textOverlayTool As New Vintasoft.Imaging.Wpf.UI.VisualTools.WpfTextOverlayTool()
    
        ' text anchor
        Dim textAnchor As Vintasoft.Imaging.AnchorType = Vintasoft.Imaging.AnchorType.Bottom Or Vintasoft.Imaging.AnchorType.Left Or Vintasoft.Imaging.AnchorType.Right Or Vintasoft.Imaging.AnchorType.Top
    
        ' create the text overlay object
        Dim textOverlay As New Vintasoft.Imaging.Wpf.UI.VisualTools.WpfTextOverlay(textAnchor, "Text Overlay Example", New System.Windows.Media.Typeface("Arial"), 24, New System.Windows.Media.SolidColorBrush(System.Windows.Media.Color.FromArgb(255, 20, 200, 20)))
    
        ' add text overlay object to the text overlay collection of text overlay visual tool
        textOverlayTool.TextOverlayCollection.Add(textOverlay)
    
        ' set visual tool as the active visual tool of image viewer
        viewer.VisualTool = textOverlayTool
    End Sub
    
    
    
    /// <summary>
    /// Shows the static text in image viewer.
    /// </summary>
    /// <param name="viewer">An image viewer.</param>
    public static void ShowStaticTextExample(Vintasoft.Imaging.Wpf.UI.WpfImageViewer viewer)
    {
        // create the text overlay visual tool
        Vintasoft.Imaging.Wpf.UI.VisualTools.WpfTextOverlayTool textOverlayTool =
            new Vintasoft.Imaging.Wpf.UI.VisualTools.WpfTextOverlayTool();
    
        // text anchor
        Vintasoft.Imaging.AnchorType textAnchor =
            Vintasoft.Imaging.AnchorType.Bottom |
            Vintasoft.Imaging.AnchorType.Left |
            Vintasoft.Imaging.AnchorType.Right |
            Vintasoft.Imaging.AnchorType.Top;
    
        // create the text overlay object
        Vintasoft.Imaging.Wpf.UI.VisualTools.WpfTextOverlay textOverlay =
            new Vintasoft.Imaging.Wpf.UI.VisualTools.WpfTextOverlay(
                textAnchor,
                "Text Overlay Example",
                new System.Windows.Media.Typeface("Arial"), 
                24, 
                new System.Windows.Media.SolidColorBrush(System.Windows.Media.Color.FromArgb(255, 20, 200, 20)));
    
        // add text overlay object to the text overlay collection of text overlay visual tool
        textOverlayTool.TextOverlayCollection.Add(textOverlay);
    
        // set visual tool as the active visual tool of image viewer
        viewer.VisualTool = textOverlayTool;
    }
    
    

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

    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.UserInteraction.WpfUserInteractionVisualTool
                                  Vintasoft.Imaging.Wpf.UI.VisualTools.GraphicObjects.WpfGraphicObjectTool
                                     Vintasoft.Imaging.Wpf.UI.VisualTools.WpfTextOverlayTool

    Требования

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

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