Jaa


MediaPlaybackSession.NormalizedSourceRect Property

Definition

Gets or sets a normalized rectangle within the video source which is rendered by the MediaPlayer. This enables pan and zoom within video.

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

void NormalizedSourceRect(Rect value);
public Rect NormalizedSourceRect { get; set; }
var rect = mediaPlaybackSession.normalizedSourceRect;
mediaPlaybackSession.normalizedSourceRect = rect;
Public Property NormalizedSourceRect As Rect

Property Value

A normalized rectangle specifying the rectangle within the source video that is rendered by the MediaPlayer.

Remarks

The x and y fields of the supplied Rect express the top and left coordinates of the source rectangle. The values for x and y must be non-negative and less than 1.0. To get a normalized top, left coordinate from pixel values, divide the desired x value, in pixels, by the value of the NaturalVideoWidth property, and multiply the desired y value, in pixels, by the value of the NaturalVideoHeight property.

The width and height fields of the supplied Rect must be non-negative. To get normalized width and height values, divide the desired width, in pixels, by the value of the NaturalVideoWidth property, and multiply the desired height value, in pixels, by the value of the NaturalVideoHeight property.

The sum of the x value and the width value must be less than 1+10-4. The sum of the y value and the height value must be less than 1+10-4.

The default value for this property is (0,0,1,1) which selects the entire source rectangle to be rendered.

Applies to