TileBrush.Stretch Property
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets or sets a value that specifies how the content of this TileBrush stretches to fit its tiles.
public:
property System::Windows::Media::Stretch Stretch { System::Windows::Media::Stretch get(); void set(System::Windows::Media::Stretch value); };
public System.Windows.Media.Stretch Stretch { get; set; }
member this.Stretch : System.Windows.Media.Stretch with get, set
Public Property Stretch As Stretch
A value that specifies how this TileBrush content is projected onto its base tile. The default value is Fill.
The Stretch property accepts the following values, which the Stretch enumeration defines:
None: The TileBrush content does not stretch to fill the tile.
Uniform: The TileBrush content is scaled to fit the tile dimensions. However, the aspect ratio of the content is preserved.
UniformToFill: The TileBrush content is scaled so that it completely fills the output area but preserves its original aspect ratio.
Fill: The TileBrush content is scaled to fit the tile. Because the content's height and width are scaled independently, the original aspect ratio of the content might not be preserved. That is, the TileBrush content might be distorted in order to completely fill the output tile.
The following image illustrates the different Stretch settings.
Different stretch settings
Note that you specify the dimensions of TileBrush content by using the Viewbox property; you specify the position and size of the TileBrush base tile by using the Viewport property.
TileBrush contents are never clipped to the Viewbox. However, TileBrush contents are clipped to the edges of the Viewport, which sets the dimensions for the TileBrush base tile.
The following illustration shows the effect of different Stretch settings on a TileBrush that has a Viewbox that is smaller than its Viewport. The parts of the image that are outside the Viewbox are tinted gray.
TileBrush with different Stretch settings
Identifier field | StretchProperty |
Metadata properties set to true |
None |
Produit | Versions |
---|---|
.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 |
Commentaires sur .NET
.NET est un projet open source. Sélectionnez un lien pour fournir des commentaires :