MediaElement.StretchDirection 속성
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
이미지에 적용되는 배율 제한을 결정하는 값을 가져오거나 설정합니다.
public:
property System::Windows::Controls::StretchDirection StretchDirection { System::Windows::Controls::StretchDirection get(); void set(System::Windows::Controls::StretchDirection value); };
public System.Windows.Controls.StretchDirection StretchDirection { get; set; }
member this.StretchDirection : System.Windows.Controls.StretchDirection with get, set
Public Property StretchDirection As StretchDirection
속성 값
요소가 늘어나는 방향을 지정하는 값입니다. 기본값은 Both입니다.
예제
<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Class="SDKSample.StretchMediaElementExample" >
<StackPanel>
<!-- This Canvas creates the bounding rectangle around the MediaElement.
How the rendered media fills this rectangle depends on the value
of the MediaElement's Stretch property. -->
<StackPanel Width="380" Height="250" Background="Green" Orientation="Horizontal" >
<MediaElement Source="media\bee.wmv" Name="myMediaElement" Stretch="UniformToFill"
/>
</StackPanel>
<!-- Buttons below change the value of the Stretch property. -->
<Button Name="btnFill" Click="OnClickChangeStretch">Fill</Button>
<Button Name="btnNone" Click="OnClickChangeStretch">None</Button>
<Button Name="btnUniform" Click="OnClickChangeStretch">Uniform</Button>
<Button Name="btnUniformToFill" Click="OnClickChangeStretch">UniformToFill</Button>
<TextBlock Name="txt1"></TextBlock>
</StackPanel>
</Page>
<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Class="SDKSample.StretchMediaElementExample" >
<StackPanel>
<!-- This Canvas creates the bounding rectangle around the MediaElement.
How the rendered media fills this rectangle depends on the value
of the MediaElement's Stretch property. -->
<StackPanel Width="380" Height="250" Background="Green" Orientation="Horizontal" >
<MediaElement Source="media\bee.wmv" Name="myMediaElement" Stretch="UniformToFill"
/>
</StackPanel>
<!-- Buttons below change the value of the Stretch property. -->
<Button Name="btnFill" Click="OnClickChangeStretch">Fill</Button>
<Button Name="btnNone" Click="OnClickChangeStretch">None</Button>
<Button Name="btnUniform" Click="OnClickChangeStretch">Uniform</Button>
<Button Name="btnUniformToFill" Click="OnClickChangeStretch">UniformToFill</Button>
<TextBlock Name="txt1"></TextBlock>
</StackPanel>
</Page>
설명
종속성 속성 정보
식별자 필드 | StretchDirectionProperty |
메타 데이터 속성 설정 true |
AffectsMeasure |