Класс WpfInteractionAreaAppearanceManager
Управляет и сохраняет настройки областей взаимодействия визуального инструмента.
Вот C#/VB.NET код, который демонстрирует, как расширить радиус и изменить цвет фона точек изменения размера и вращения.
''' <summary>
''' Creates the custom interaction area appearance manager.
''' </summary>
''' <param name="visualTool">The visual tool.</param>
''' <returns>
''' The custom interaction area appearance manager.
''' </returns>
Public Function CreateCustomInteractionAreaAppearanceManager(visualTool As Vintasoft.Imaging.Wpf.UI.VisualTools.UserInteraction.WpfUserInteractionVisualTool) As Vintasoft.Imaging.Wpf.UI.VisualTools.UserInteraction.WpfInteractionAreaAppearanceManager
' create manager
Dim manager As New Vintasoft.Imaging.Wpf.UI.VisualTools.UserInteraction.WpfInteractionAreaAppearanceManager()
manager.VisualTool = visualTool
' begin the initialization of manager
manager.BeginInit()
' resize point
manager.ResizePointsRadius = 10
manager.ResizePointsInteractionRadius = 10
manager.ResizePointsBackgroundColor = System.Windows.Media.Color.FromArgb(128, 255, 255, 0)
' rotation point
manager.RotationPointDistance = 30
manager.RotationPointRadius = 10
manager.RotationPointInteractionRadius = 10
manager.RotationPointBackgroundColor = System.Windows.Media.Color.FromArgb(128, 255, 192, 203)
' end the initialization of manager
manager.EndInit()
' return the manager
Return manager
End Function
/// <summary>
/// Creates the custom interaction area appearance manager.
/// </summary>
/// <param name="visualTool">The visual tool.</param>
/// <returns>
/// The custom interaction area appearance manager.
/// </returns>
public Vintasoft.Imaging.Wpf.UI.VisualTools.UserInteraction.WpfInteractionAreaAppearanceManager CreateCustomInteractionAreaAppearanceManager(
Vintasoft.Imaging.Wpf.UI.VisualTools.UserInteraction.WpfUserInteractionVisualTool visualTool)
{
// create manager
Vintasoft.Imaging.Wpf.UI.VisualTools.UserInteraction.WpfInteractionAreaAppearanceManager manager =
new Vintasoft.Imaging.Wpf.UI.VisualTools.UserInteraction.WpfInteractionAreaAppearanceManager();
manager.VisualTool = visualTool;
// begin the initialization of manager
manager.BeginInit();
// resize point
manager.ResizePointsRadius = 10;
manager.ResizePointsInteractionRadius = 10;
manager.ResizePointsBackgroundColor = System.Windows.Media.Color.FromArgb(128, 255, 255, 0);
// rotation point
manager.RotationPointDistance = 30;
manager.RotationPointRadius = 10;
manager.RotationPointInteractionRadius = 10;
manager.RotationPointBackgroundColor = System.Windows.Media.Color.FromArgb(128, 255, 192, 203);
// end the initialization of manager
manager.EndInit();
// return the manager
return manager;
}
Целевые платформы: .NET 8; .NET 7; .NET 6; .NET Framework 4.8, 4.7, 4.6, 4.5, 4.0, 3.5