ScaleTransform
ScaleTransform
ScaleTransform
ScaleTransform
Class
Definition
Scales an object in the two-dimensional x-y coordinate system.
public : sealed class ScaleTransform : Transform, IScaleTransformpublic sealed class ScaleTransform : Transform, IScaleTransformPublic NotInheritable Class ScaleTransform Inherits Transform Implements IScaleTransform// This API is not available in Javascript.
<ScaleTransform .../>
- Inheritance
-
ScaleTransformScaleTransformScaleTransformScaleTransform
- Attributes
| Device family |
Windows 10 (introduced v10.0.10240.0)
|
| API contract |
Windows.Foundation.UniversalApiContract (introduced v1)
|
Inherited Members
Inherited methods
Inherited properties
Examples
This XAML example uses a ScaleTransform to scale text from its original size.
<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="1.5" />
</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
Constructors
ScaleTransform() ScaleTransform() ScaleTransform() ScaleTransform()
Initializes a new instance of the ScaleTransform class.
public : ScaleTransform()public ScaleTransform()Public Sub New()// This API is not available in Javascript.
Properties
CenterX CenterX CenterX CenterX
Gets or sets the x-coordinate of the center point of this ScaleTransform.
public : double CenterX { get; set; }public double CenterX { get; set; }Public ReadWrite Property CenterX As double// This API is not available in Javascript.
<ScaleTransform CenterX="double"/>
- Value
- double double double double
The x-coordinate of the center point of this ScaleTransform. The default is 0.
CenterXProperty CenterXProperty CenterXProperty CenterXProperty
Identifies the CenterX dependency property.
public : static DependencyProperty CenterXProperty { get; }public static DependencyProperty CenterXProperty { get; }Public Static ReadOnly Property CenterXProperty As DependencyProperty// This API is not available in Javascript.
The identifier for the CenterX dependency property.
CenterY CenterY CenterY CenterY
Gets or sets the y-coordinate of the center point of this ScaleTransform.
public : double CenterY { get; set; }public double CenterY { get; set; }Public ReadWrite Property CenterY As double// This API is not available in Javascript.
<ScaleTransform CenterY="double"/>
- Value
- double double double double
The y-coordinate of the center point of this ScaleTransform. The default is 0.
CenterYProperty CenterYProperty CenterYProperty CenterYProperty
Identifies the CenterY dependency property.
public : static DependencyProperty CenterYProperty { get; }public static DependencyProperty CenterYProperty { get; }Public Static ReadOnly Property CenterYProperty As DependencyProperty// This API is not available in Javascript.
The identifier for the CenterY dependency property.
ScaleX ScaleX ScaleX ScaleX
Gets or sets the x-axis scale factor.
public : double ScaleX { get; set; }public double ScaleX { get; set; }Public ReadWrite Property ScaleX As double// This API is not available in Javascript.
<ScaleTransform ScaleX="double"/>
- Value
- double double double double
The scale factor along the x-axis. The default is 1.
ScaleXProperty ScaleXProperty ScaleXProperty ScaleXProperty
Identifies the ScaleX dependency property.
public : static DependencyProperty ScaleXProperty { get; }public static DependencyProperty ScaleXProperty { get; }Public Static ReadOnly Property ScaleXProperty As DependencyProperty// This API is not available in Javascript.
The identifier for the ScaleX dependency property.
ScaleY ScaleY ScaleY ScaleY
Gets or sets the y-axis scale factor.
public : double ScaleY { get; set; }public double ScaleY { get; set; }Public ReadWrite Property ScaleY As double// This API is not available in Javascript.
<ScaleTransform ScaleY="double"/>
- Value
- double double double double
The scale factor along the y-axis. The default is 1.
ScaleYProperty ScaleYProperty ScaleYProperty ScaleYProperty
Identifies the ScaleY dependency property.
public : static DependencyProperty ScaleYProperty { get; }public static DependencyProperty ScaleYProperty { get; }Public Static ReadOnly Property ScaleYProperty As DependencyProperty// This API is not available in Javascript.
The identifier for the ScaleY dependency property.