StylusPlugIn.ElementBounds Propiedad

Definición

Obtiene los límites del elemento almacenados en memoria caché.

C#
public System.Windows.Rect ElementBounds { get; }

Valor de propiedad

Los límites del elemento almacenados en memoria caché.

Ejemplos

En el ejemplo siguiente se muestra cómo un DynamicRenderer, que hereda de StylusPlugIn, usa un ImageBrush para representar un trazo. Este pincel dibuja parcialmente el archivo de imagen especificado por imageFile.

C#
if (imageBrush == null)
{
    // Create an ImageBrush.  imageFile is a string that's a path to an image file.
    image1 = new BitmapImage(new Uri(imageFile));
    imageBrush = new ImageBrush(image1);

    // Don't tile, don't stretch; align to top/left.
    imageBrush.TileMode = TileMode.None;
    imageBrush.Stretch = Stretch.None;
    imageBrush.AlignmentX = AlignmentX.Left;
    imageBrush.AlignmentY = AlignmentY.Top;

    // Map the brush to the entire bounds of the element.
    imageBrush.ViewportUnits = BrushMappingMode.Absolute;
    imageBrush.Viewport = this.ElementBounds;
    imageBrush.Freeze();
}

Comentarios

Almacena StylusPlugIn en caché los límites de su elemento para realizar pruebas de posicionamiento.

Se aplica a

Producto Versiones
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10