В этом разделе
Определяет, как отображать аннотацию, отображающую дугу.
Объектная модель
Синтаксис
Пример
Вот пример, показывающий, как изменить цвет начальной и конечной точек аннотации дуги:
''' <summary>
''' Sets the color for first and second points of arc annotation.
''' </summary>
''' <param name="arcAnnotationView">The arc annotation view.</param>
''' <param name="firstArcPointColor">The color of the first point of arc annotation.</param>
''' <param name="secondArcPointColor">The color of the second point of arc annotation.</param>
Public Sub SetInteractionPointsColor(arcAnnotationView As Vintasoft.Imaging.Annotation.UI.ArcAnnotationView, firstArcPointColor As System.Drawing.Color, secondArcPointColor As System.Drawing.Color)
If arcAnnotationView Is Nothing Then
Return
End If
SetInteractionPointsColor(arcAnnotationView.InteractionController, firstArcPointColor, secondArcPointColor)
End Sub
''' <summary>
''' Finds the <see cref="Vintasoft.Imaging.Annotation.UI.VisualTools.UserInteraction.PointBasedAnnotationPointTransformer"/> and updates
''' the <see cref="Vintasoft.Imaging.Annotation.UI.VisualTools.UserInteraction.ArcTransformationInteractionPoint.FirstPointFillColor"/> and
''' the <see cref="Vintasoft.Imaging.Annotation.UI.VisualTools.UserInteraction.ArcTransformationInteractionPoint.SecondPointFillColor"/>.
''' </summary>
''' <param name="interactionController">The interaction controller.</param>
''' <param name="firstArcPointColor">The color of the first point of arc annotation.</param>
''' <param name="secondArcPointColor">The color of the second point of arc annotation.</param>
Private Sub SetInteractionPointsColor(interactionController As Vintasoft.Imaging.UI.VisualTools.UserInteraction.IInteractionController, firstArcPointColor As System.Drawing.Color, secondArcPointColor As System.Drawing.Color)
' if interaction controller is composite interaction controller
If TypeOf interactionController Is Vintasoft.Imaging.UI.VisualTools.UserInteraction.CompositeInteractionController Then
Dim compositeInteractionController As Vintasoft.Imaging.UI.VisualTools.UserInteraction.CompositeInteractionController = TryCast(interactionController, Vintasoft.Imaging.UI.VisualTools.UserInteraction.CompositeInteractionController)
' for each interaction controller in composite interaction controller
For Each item As Vintasoft.Imaging.UI.VisualTools.UserInteraction.IInteractionController In compositeInteractionController.Items
SetInteractionPointsColor(item, firstArcPointColor, secondArcPointColor)
Next
End If
' if interaction controller is the point-based annotation point transformer
If TypeOf interactionController Is Vintasoft.Imaging.Annotation.UI.VisualTools.UserInteraction.PointBasedAnnotationPointTransformer Then
Dim pointTransformer As Vintasoft.Imaging.Annotation.UI.VisualTools.UserInteraction.PointBasedAnnotationPointTransformer = TryCast(interactionController, Vintasoft.Imaging.Annotation.UI.VisualTools.UserInteraction.PointBasedAnnotationPointTransformer)
' if transformer is used for transforming of arc transformation interaction point
If TypeOf pointTransformer.PolygonPointTemplate Is Vintasoft.Imaging.Annotation.UI.VisualTools.UserInteraction.ArcTransformationInteractionPoint Then
' get the interactive point that is used for changing the arc annotation
Dim arcTransformationInteractionPoint As Vintasoft.Imaging.Annotation.UI.VisualTools.UserInteraction.ArcTransformationInteractionPoint = DirectCast(pointTransformer.PolygonPointTemplate, Vintasoft.Imaging.Annotation.UI.VisualTools.UserInteraction.ArcTransformationInteractionPoint)
' set color of the first point of arc annotation
arcTransformationInteractionPoint.FirstPointFillColor = firstArcPointColor
' set color of the second point of arc annotation
arcTransformationInteractionPoint.SecondPointFillColor = secondArcPointColor
End If
End If
End Sub
/// <summary>
/// Sets the color for first and second points of arc annotation.
/// </summary>
/// <param name="arcAnnotationView">The arc annotation view.</param>
/// <param name="firstArcPointColor">The color of the first point of arc annotation.</param>
/// <param name="secondArcPointColor">The color of the second point of arc annotation.</param>
public void SetInteractionPointsColor(
Vintasoft.Imaging.Annotation.UI.ArcAnnotationView arcAnnotationView,
System.Drawing.Color firstArcPointColor,
System.Drawing.Color secondArcPointColor)
{
if (arcAnnotationView == null)
return;
SetInteractionPointsColor(arcAnnotationView.InteractionController, firstArcPointColor, secondArcPointColor);
}
/// <summary>
/// Finds the <see cref="Vintasoft.Imaging.Annotation.UI.VisualTools.UserInteraction.PointBasedAnnotationPointTransformer"/> and updates
/// the <see cref="Vintasoft.Imaging.Annotation.UI.VisualTools.UserInteraction.ArcTransformationInteractionPoint.FirstPointFillColor"/> and
/// the <see cref="Vintasoft.Imaging.Annotation.UI.VisualTools.UserInteraction.ArcTransformationInteractionPoint.SecondPointFillColor"/>.
/// </summary>
/// <param name="interactionController">The interaction controller.</param>
/// <param name="firstArcPointColor">The color of the first point of arc annotation.</param>
/// <param name="secondArcPointColor">The color of the second point of arc annotation.</param>
private void SetInteractionPointsColor(
Vintasoft.Imaging.UI.VisualTools.UserInteraction.IInteractionController interactionController,
System.Drawing.Color firstArcPointColor,
System.Drawing.Color secondArcPointColor)
{
// if interaction controller is composite interaction controller
if (interactionController is Vintasoft.Imaging.UI.VisualTools.UserInteraction.CompositeInteractionController)
{
Vintasoft.Imaging.UI.VisualTools.UserInteraction.CompositeInteractionController compositeInteractionController =
interactionController as Vintasoft.Imaging.UI.VisualTools.UserInteraction.CompositeInteractionController;
// for each interaction controller in composite interaction controller
foreach (Vintasoft.Imaging.UI.VisualTools.UserInteraction.IInteractionController item in compositeInteractionController.Items)
SetInteractionPointsColor(item, firstArcPointColor, secondArcPointColor);
}
// if interaction controller is the point-based annotation point transformer
if (interactionController is Vintasoft.Imaging.Annotation.UI.VisualTools.UserInteraction.PointBasedAnnotationPointTransformer)
{
Vintasoft.Imaging.Annotation.UI.VisualTools.UserInteraction.PointBasedAnnotationPointTransformer pointTransformer =
interactionController as Vintasoft.Imaging.Annotation.UI.VisualTools.UserInteraction.PointBasedAnnotationPointTransformer;
// if transformer is used for transforming of arc transformation interaction point
if (pointTransformer.PolygonPointTemplate is Vintasoft.Imaging.Annotation.UI.VisualTools.UserInteraction.ArcTransformationInteractionPoint)
{
// get the interactive point that is used for changing the arc annotation
Vintasoft.Imaging.Annotation.UI.VisualTools.UserInteraction.ArcTransformationInteractionPoint arcTransformationInteractionPoint =
(Vintasoft.Imaging.Annotation.UI.VisualTools.UserInteraction.ArcTransformationInteractionPoint)pointTransformer.PolygonPointTemplate;
// set color of the first point of arc annotation
arcTransformationInteractionPoint.FirstPointFillColor = firstArcPointColor;
// set color of the second point of arc annotation
arcTransformationInteractionPoint.SecondPointFillColor = secondArcPointColor;
}
}
}
Иерархия наследования
System.Object
 Vintasoft.Imaging.Annotation.UI.AnnotationView
   Vintasoft.Imaging.Annotation.UI.ArcAnnotationView
Требования
Целевые платформы: .NET 8; .NET 7; .NET 6; .NET Framework 4.8, 4.7, 4.6, 4.5, 4.0, 3.5
Смотрите также