Exportar (0) Imprimir
Expandir todo
Expandir Minimizar

Stretch (Enumeración)

Describes how content is resized to fill its allocated space.

Espacio de nombres: System.Windows.Media
Ensamblado: PresentationCore (en presentationcore.dll)
Espacio de nombres XML:  http://schemas.microsoft.com/winfx/2006/xaml/presentation

public enum Stretch
public enum Stretch
public enum Stretch
<propiedad de objeto="EnumerationValue" .../>

 Nombre de miembroDescripción
FillThe content is resized to fill the destination dimensions. The aspect ratio is not preserved.  
NoneThe content preserves its original size.  
UniformThe content is resized to fit in the destination dimensions while it preserves its native aspect ratio.  
UniformToFillThe content is resized to fill the destination dimensions while it preserves its native aspect ratio. If the aspect ratio of the destination rectangle differs from the source, the source content is clipped to fit in the destination dimensions. 

The following illustration shows the different Stretch values.

Stretch values


Different TileBrush Stretch settings

The following example shows how to create an instance of a Viewbox and set the Stretch mode of its content by using code.


// Create a Viewbox and add it to the Canvas
myViewbox = new Viewbox();
myViewbox.StretchDirection = StretchDirection.Both;
myViewbox.Stretch = Stretch.Fill;
myViewbox.MaxWidth = 400;
myViewbox.MaxHeight = 400;

Microsoft .NET Framework 3.0 es compatible con Windows Vista, Microsoft Windows XP SP2 y Windows Server 2003 SP1.

.NET Framework

Compatible con: 3.0

Adiciones de comunidad

AGREGAR
Mostrar:
© 2015 Microsoft