Visual.HitTestCore Visual.HitTestCore Visual.HitTestCore Visual.HitTestCore Method

Definición

Determina si un punto geométrico está dentro de los límites del objeto visual.Determines whether a point or geometry value is within the bounds of the visual object.

Sobrecargas

HitTestCore(GeometryHitTestParameters) HitTestCore(GeometryHitTestParameters) HitTestCore(GeometryHitTestParameters) HitTestCore(GeometryHitTestParameters)

Determina si un valor geométrico está dentro de los límites del objeto visual.Determines whether a geometry value is within the bounds of the visual object.

HitTestCore(PointHitTestParameters) HitTestCore(PointHitTestParameters) HitTestCore(PointHitTestParameters) HitTestCore(PointHitTestParameters)

Determina si un valor de coordenada de punto está dentro de los límites del objeto visual.Determines whether a point coordinate value is within the bounds of the visual object.

HitTestCore(GeometryHitTestParameters) HitTestCore(GeometryHitTestParameters) HitTestCore(GeometryHitTestParameters) HitTestCore(GeometryHitTestParameters)

Determina si un valor geométrico está dentro de los límites del objeto visual.Determines whether a geometry value is within the bounds of the visual object.

protected:
 virtual System::Windows::Media::GeometryHitTestResult ^ HitTestCore(System::Windows::Media::GeometryHitTestParameters ^ hitTestParameters);
protected virtual System.Windows.Media.GeometryHitTestResult HitTestCore (System.Windows.Media.GeometryHitTestParameters hitTestParameters);
abstract member HitTestCore : System.Windows.Media.GeometryHitTestParameters -> System.Windows.Media.GeometryHitTestResult
override this.HitTestCore : System.Windows.Media.GeometryHitTestParameters -> System.Windows.Media.GeometryHitTestResult
Protected Overridable Function HitTestCore (hitTestParameters As GeometryHitTestParameters) As GeometryHitTestResult

Parámetros

hitTestParameters
GeometryHitTestParameters GeometryHitTestParameters GeometryHitTestParameters GeometryHitTestParameters

Objeto GeometryHitTestParameters que especifica el objeto Geometry en el que se ejecuta la prueba de posicionamiento.A GeometryHitTestParameters object that specifies the Geometry to hit test against.

Devoluciones

Objeto GeometryHitTestResult que representa el resultado de la prueba de posicionamiento.A GeometryHitTestResult that represents the result of the hit test.

Ejemplos

En el ejemplo siguiente se muestra cómo se invalida el método HitTestCore(GeometryHitTestParameters).The following example shows how to override the HitTestCore(GeometryHitTestParameters) method. Una razón que desea invalidar este método es proporcionar funcionalidad adicional durante el proceso de prueba de posicionamiento.One reason you might want to override this method is to provide additional functionality during the hit testing process.

// Override default hit test support in visual object.
protected override GeometryHitTestResult HitTestCore(GeometryHitTestParameters hitTestParameters)
{
    IntersectionDetail intersectionDetail = IntersectionDetail.NotCalculated;

    // Perform custom actions during the hit test processing.

    return new GeometryHitTestResult(this, intersectionDetail);
}
' Override default hit test support in visual object.
Protected Overrides Overloads Function HitTestCore(ByVal hitTestParameters As GeometryHitTestParameters) As GeometryHitTestResult
	Dim intersectionDetail As IntersectionDetail = IntersectionDetail.NotCalculated

	' Perform custom actions during the hit test processing.

	Return New GeometryHitTestResult(Me, intersectionDetail)
End Function

Comentarios

Puede invalidar de posicionamiento predeterminada de las pruebas de compatibilidad para un objeto visual invalidando el HitTestCore método.You can override default hit testing support for a visual object by overriding the HitTestCore method. Esto significa que cuando se invoca el HitTest método, la implementación de invalidación HitTestCore se llama.This means that when you invoke the HitTest method, your overridden implementation of HitTestCore is called. El método invalidado se llama cuando una prueba de posicionamiento está dentro del rectángulo delimitador del objeto visual, incluso si la coordenada esté fuera de la geometría del objeto visual.Your overridden method is called when a hit test falls within the bounding rectangle of the visual object, even if the coordinate falls outside the geometry of the visual object.

HitTestCore(PointHitTestParameters) HitTestCore(PointHitTestParameters) HitTestCore(PointHitTestParameters) HitTestCore(PointHitTestParameters)

Determina si un valor de coordenada de punto está dentro de los límites del objeto visual.Determines whether a point coordinate value is within the bounds of the visual object.

protected:
 virtual System::Windows::Media::HitTestResult ^ HitTestCore(System::Windows::Media::PointHitTestParameters ^ hitTestParameters);
protected virtual System.Windows.Media.HitTestResult HitTestCore (System.Windows.Media.PointHitTestParameters hitTestParameters);
abstract member HitTestCore : System.Windows.Media.PointHitTestParameters -> System.Windows.Media.HitTestResult
override this.HitTestCore : System.Windows.Media.PointHitTestParameters -> System.Windows.Media.HitTestResult
Protected Overridable Function HitTestCore (hitTestParameters As PointHitTestParameters) As HitTestResult

Parámetros

hitTestParameters
PointHitTestParameters PointHitTestParameters PointHitTestParameters PointHitTestParameters

Objeto PointHitTestParameters que especifica el objeto Point en el que se ejecuta la prueba de posicionamiento.A PointHitTestParameters object that specifies the Point to hit test against.

Devoluciones

Objeto HitTestResult, que representa el objeto Visual devuelto desde la prueba de posicionamiento.A HitTestResult that represents the Visual that is returned from a hit test.

Ejemplos

En el ejemplo siguiente se muestra cómo se invalida el método HitTestCore(PointHitTestParameters).The following example shows how to override the HitTestCore(PointHitTestParameters) method. Una razón que desea invalidar este método es proporcionar funcionalidad adicional durante el proceso de prueba de posicionamiento.One reason you might want to override this method is to provide additional functionality during the hit testing process.

// Override default hit test support in visual object.
protected override HitTestResult HitTestCore(PointHitTestParameters hitTestParameters)
{
    Point pt = hitTestParameters.HitPoint;

    // Perform custom actions during the hit test processing,
    // which may include verifying that the point actually
    // falls within the rendered content of the visual.

    // Return hit on bounding rectangle of visual object.
    return new PointHitTestResult(this, pt);
}
' Override default hit test support in visual object.
Protected Overrides Overloads Function HitTestCore(ByVal hitTestParameters As PointHitTestParameters) As HitTestResult
	Dim pt As Point = hitTestParameters.HitPoint

	' Perform custom actions during the hit test processing,
	' which may include verifying that the point actually
	' falls within the rendered content of the visual.

	' Return hit on bounding rectangle of visual object.
	Return New PointHitTestResult(Me, pt)
End Function

Comentarios

Puede invalidar la compatibilidad en objetos visuales mediante la invalidación de la prueba de posicionamiento predeterminada la HitTestCore método.You can override the default hit testing support on visual objects by overriding the HitTestCore method. Esto significa que cuando se invoca el HitTest método, la implementación de invalidación HitTestCore se llama.This means that when you invoke the HitTest method, your overridden implementation of HitTestCore is called. El método invalidado se llama cuando una prueba de posicionamiento está dentro del rectángulo delimitador del objeto visual, incluso si la coordenada esté fuera de la geometría del objeto visual.Your overridden method is called when a hit test falls within the bounding rectangle of the visual object, even if the coordinate falls outside the geometry of the visual object.

Se aplica a