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 クラスの新しいインスタンスを初期化します。

プロパティ

CenterX

この ScaleTransform の中心点の x 座標を取得または設定します。

CenterXProperty

CenterX 依存関係プロパティを識別します。

CenterY

この ScaleTransform の中心点の y 座標を取得または設定します。

CenterYProperty

CenterY 依存関係プロパティを識別します。

Dispatcher

このオブジェクトが関連付けられている CoreDispatcher を取得します。 CoreDispatcher は、コードが UI 以外のスレッドによって開始された場合でも、UI スレッド上の DependencyObject にアクセスできる機能を表します。

(継承元 DependencyObject)
Inverse

可能であれば、この GeneralTransform の逆変換を取得します。

(継承元 GeneralTransform)
InverseCore

派生またはカスタムの GeneralTransformの戻り値の動作を実装します。

(継承元 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 インスタンスの特定の 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)

適用対象

こちらもご覧ください