ScaleTransform 클래스

정의

2차원 x-y 좌표계의 개체 크기를 조정합니다.

public ref class ScaleTransform sealed : Transform
/// [Windows.Foundation.Metadata.Activatable(65536, Windows.Foundation.UniversalApiContract)]
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class ScaleTransform final : Transform
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
/// [Windows.Foundation.Metadata.Activatable(65536, "Windows.Foundation.UniversalApiContract")]
class ScaleTransform final : Transform
[Windows.Foundation.Metadata.Activatable(65536, typeof(Windows.Foundation.UniversalApiContract))]
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class ScaleTransform : Transform
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
[Windows.Foundation.Metadata.Activatable(65536, "Windows.Foundation.UniversalApiContract")]
public sealed class ScaleTransform : Transform
Public NotInheritable Class ScaleTransform
Inherits Transform
<ScaleTransform .../>
상속
Object Platform::Object IInspectable DependencyObject GeneralTransform Transform ScaleTransform
특성

Windows 요구 사항

디바이스 패밀리
Windows 10 (10.0.10240.0에서 도입되었습니다.)
API contract
Windows.Foundation.UniversalApiContract (v1.0에서 도입되었습니다.)

예제

이 XAML 예제에서는 ScaleTransform을 사용하여 원래 크기에서 텍스트 크기를 조정합니다.

<StackPanel>
    <TextBlock FontFamily="Verdana"
               FontSize="32"
               FontWeight="Bold" 
               Foreground="SteelBlue"
               Text="Scaled Text" />

    <!-- Scale the text width using a ScaleTransform. -->
    <TextBlock FontFamily="Verdana"
               FontSize="32"
               FontWeight="Bold"
               Foreground="SteelBlue"
               Text="Scaled Text">
        <TextBlock.RenderTransform>
            <ScaleTransform ScaleX="1.5" ScaleY="1.0" />
        </TextBlock.RenderTransform>
    </TextBlock>

    <!-- Scale the text height using a ScaleTransform. -->
    <TextBlock FontFamily="Verdana"
               FontSize="32"
               FontWeight="Bold" 
               Foreground="SteelBlue"
               Text="Scaled Text">
        <TextBlock.RenderTransform>
            <ScaleTransform ScaleX="1.0" ScaleY="2.0" />
        </TextBlock.RenderTransform>
    </TextBlock>
</StackPanel>

변환이 적용된 후 텍스트는 다음과 같습니다.

배율 변환이 적용된 텍스트

이 예제에서는 런타임에 코드에서 변환에 액세스하고 수정하는 방법을 보여 줍니다. 사각형을 누를 때마다 배율도 증가합니다.

<StackPanel>
  <Rectangle PointerPressed="HandlePointerPressed"
    Width="50" Height="50" Fill="RoyalBlue">
    <Rectangle.RenderTransform>

      <!-- If you give the transform a name you can 
        access it easily from code. -->
      <ScaleTransform x:Name="myScaleTransform" />
    </Rectangle.RenderTransform>
  </Rectangle>
</StackPanel>
private void HandlePointerPressed(object sender, PointerRoutedEventArgs e)
{
    // Increase ScaleX and ScaleY by 25%.
    myScaleTransform.ScaleX = myScaleTransform.ScaleX * 1.25;
    myScaleTransform.ScaleY = myScaleTransform.ScaleY * 1.25;
}
Private Sub HandlePointerPressed(ByVal sender As Object, ByVal e As PointerRoutedEventArgs)
    ' Increase ScaleX and ScaleY by 25%.
    myScaleTransform.ScaleX = (myScaleTransform.ScaleX * 1.25)
    myScaleTransform.ScaleY = (myScaleTransform.ScaleY * 1.25)
End Sub

생성자

ScaleTransform()

ScaleTransform 클래스의 새 instance 초기화합니다.

속성

CenterX

ScaleTransform의 중심점 x 좌표를 가져오거나 설정합니다.

CenterXProperty

CenterX 종속성 속성을 식별합니다.

CenterY

ScaleTransform의 중심점 y 좌표를 가져오거나 설정합니다.

CenterYProperty

CenterY 종속성 속성을 식별합니다.

Dispatcher

이 개체가 연결된 CoreDispatcher 를 가져옵니다. CoreDispatcher는 코드가 비 UI 스레드에서 시작되더라도 UI 스레드에서 DependencyObject에 액세스할 수 있는 기능을 나타냅니다.

(다음에서 상속됨 DependencyObject)
Inverse

가능한 경우 이 GeneralTransform의 역 변환을 가져옵니다.

(다음에서 상속됨 GeneralTransform)
InverseCore

파생 또는 사용자 지정 GeneralTransform에서 Inverse의 반환 값에 대한 동작을 구현합니다.

(다음에서 상속됨 GeneralTransform)
ScaleX

x-축 배율을 가져오거나 설정합니다.

ScaleXProperty

ScaleX 종속성 속성을 식별합니다.

ScaleY

y-축 배율 요소를 가져오거나 설정합니다.

ScaleYProperty

ScaleY 종속성 속성을 식별합니다.

메서드

ClearValue(DependencyProperty)

종속성 속성의 로컬 값을 지웁니다.

(다음에서 상속됨 DependencyObject)
GetAnimationBaseValue(DependencyProperty)

애니메이션이 활성화되지 않은 경우에 적용되는 종속성 속성에 대해 설정된 기본 값을 반환합니다.

(다음에서 상속됨 DependencyObject)
GetValue(DependencyProperty)

DependencyObject에서 종속성 속성의 현재 유효 값을 반환합니다.

(다음에서 상속됨 DependencyObject)
ReadLocalValue(DependencyProperty)

로컬 값이 설정된 경우 종속성 속성의 로컬 값을 반환합니다.

(다음에서 상속됨 DependencyObject)
RegisterPropertyChangedCallback(DependencyProperty, DependencyPropertyChangedCallback)

DependencyObject instance 특정 DependencyProperty에 대한 변경 내용을 수신 대기하기 위한 알림 함수를 등록합니다.

(다음에서 상속됨 DependencyObject)
SetValue(DependencyProperty, Object)

DependencyObject에 대한 종속성 속성의 로컬 값을 설정합니다.

(다음에서 상속됨 DependencyObject)
TransformBounds(Rect)

지정한 경계 상자를 변환한 다음 해당 경계 상자를 포함할 수 있는 크기의 축에 맞춰진 경계 상자를 반환합니다.

(다음에서 상속됨 GeneralTransform)
TransformBoundsCore(Rect)

파생된 변환 클래스에서 TransformBounds 동작을 재정의하는 수단을 제공합니다.

(다음에서 상속됨 GeneralTransform)
TransformPoint(Point)

이 변환 개체의 논리를 사용하여 지정된 지점을 변환하고 결과를 반환합니다.

(다음에서 상속됨 GeneralTransform)
TryTransform(Point, Point)

지정한 점의 변환을 시도한 후 변환의 성공 여부를 나타내는 값을 반환합니다.

(다음에서 상속됨 GeneralTransform)
TryTransformCore(Point, Point)

파생 변환 클래스에서 TryTransform 동작을 재정의하는 수단을 제공합니다.

(다음에서 상속됨 GeneralTransform)
UnregisterPropertyChangedCallback(DependencyProperty, Int64)

RegisterPropertyChangedCallback을 호출하여 이전에 등록된 변경 알림을 취소합니다.

(다음에서 상속됨 DependencyObject)

적용 대상

추가 정보