Udostępnij za pośrednictwem


MediaPlayerElement.Stretch Property

Definition

Gets or sets a value that describes how an MediaPlayerElement should be stretched to fill the destination rectangle.

public:
 property Stretch Stretch { Stretch get(); void set(Stretch value); };
Stretch Stretch();

void Stretch(Stretch value);
public Stretch Stretch { get; set; }
var stretch = mediaPlayerElement.stretch;
mediaPlayerElement.stretch = stretch;
Public Property Stretch As Stretch
<MediaPlayerElement Stretch="stretchMemberName" />

Property Value

A value of the Stretch enumeration that specifies how the source visual media is rendered. The default value is Uniform.

Remarks

Here's what the Stretch values represent for MediaPlayerElement content:

  • None: The original size of the content is preserved.
  • Fill: The content is resized to fill the destination dimensions. The aspect ratio of the video is not preserved.
  • UniformToFill: Uniformly stretches the MediaPlayerElement to fill the available layout space while preserving the aspect ratio of the content. If the aspect ratio of the destination rectangle differs from the source, the source content is clipped to fit the destination dimensions.
  • Uniform: Uniformly stretches the MediaPlayerElement to fill the layout space while preserve the aspect ratio of the image. This will ensure that the entire image is displayed, undistorted and not cropped. This may result in letterboxing or pillarboxing on the top or sides of the image, depending on the aspect ratio of the content.

Applies to