Modifier

Partager via


TileBrush.ViewportUnits Property

Definition

Gets or sets a BrushMappingMode enumeration that specifies whether the value of the Viewport, which indicates the size and position of the TileBrush base tile, is relative to the size of the output area.

public:
 property System::Windows::Media::BrushMappingMode ViewportUnits { System::Windows::Media::BrushMappingMode get(); void set(System::Windows::Media::BrushMappingMode value); };
public System.Windows.Media.BrushMappingMode ViewportUnits { get; set; }
member this.ViewportUnits : System.Windows.Media.BrushMappingMode with get, set
Public Property ViewportUnits As BrushMappingMode

Property Value

Indicates whether the value of the Viewport, which describes the size and position of the TileBrush tiles, is relative to the size of the whole output area. The default value is RelativeToBoundingBox.

Remarks

The Viewport property determines the size and position of the tiles in a TileBrush. By default, a TileBrush has a single tile that fills the whole output area. The Stretch property controls how the TileBrush content fits into that tile. You can override this default behavior and specify the tile size by using the Viewport property.

Use the ViewportUnits property to specify whether the Viewport uses absolute or relative coordinates. If the coordinates are relative, they are relative to the size of the output area. The point (0,0) represents the upper-left corner of the output area, and (1,1) represents the lower-right corner of the output area. To specify that the Viewport property uses absolute coordinates, set the ViewportUnits property to Absolute.

The following illustration shows the difference in output when you set the ViewportUnits property of a TileBrush to either relative or absolute.

Absolute and Relative Viewport Units Relative and absolute ViewportUnits

Dependency Property Information

Identifier field ViewportUnitsProperty
Metadata properties set to true None

Applies to

See also