Ce sujet n'a pas encore été évalué - Évaluez ce sujet

StrokeCollection.HitTest, méthode (Point, Double)

Returns a collection of strokes that intersect the specified area.

Espace de noms: System.Windows.Ink
Assembly : PresentationCore (dans presentationcore.dll)

public StrokeCollection HitTest (
	Point point,
	double diameter
)
public StrokeCollection HitTest (
	Point point, 
	double diameter
)
public function HitTest (
	point : Point, 
	diameter : double
) : StrokeCollection
Vous ne pouvez pas utiliser des méthodes dans XAML.

Paramètres

point

The Point to hit test.

diameter

The size of the area around the Point to hit test.

Valeur de retour

A collection of Stroke objects that intersect the specified point.

The following example demonstrates how to get the strokes that intersect the specified Point. This example assumes that there is an InkPresenter called presenter.

// Change the color of all the strokes at the specified position.
public void SelectStrokes(Point position)
{
    StrokeCollection selected = presenter.Strokes.HitTest(position, 5);

    foreach (Stroke s in selected)
    {
        s.DrawingAttributes.Color = Colors.Purple;
    }

}

Microsoft .NET Framework 3.0 est pris en charge sur Windows Vista, Microsoft Windows XP SP2 et Windows Server 2003 SP1.

.NET Framework

Prise en charge dans : 3.0
Cela vous a-t-il été utile ?
(1500 caractères restants)

Ajouts de la communauté

AJOUTER
© 2013 Microsoft. Tous droits réservés.