Share via


Renderer.Scale Method (Single, Single, Boolean)

Scales the GetViewTransform in the X and Y dimensions. When the scaling factors are not applied to the width of the drawing attributes of the ink (by passing false to the applyOnPenWidth parameter), the scaling occurs on the GetObjectTransform instead.

Namespace:  Microsoft.Ink
Assembly:  Microsoft.Ink (in Microsoft.Ink.dll)

Syntax

'Declaration
Public Sub Scale ( _
    scaleX As Single, _
    scaleY As Single, _
    applyOnPenWidth As Boolean _
)
'Usage
Dim instance As Renderer 
Dim scaleX As Single 
Dim scaleY As Single 
Dim applyOnPenWidth As Boolean

instance.Scale(scaleX, scaleY, applyOnPenWidth)
public void Scale(
    float scaleX,
    float scaleY,
    bool applyOnPenWidth
)
public:
void Scale(
    float scaleX, 
    float scaleY, 
    bool applyOnPenWidth
)
public function Scale(
    scaleX : float, 
    scaleY : float, 
    applyOnPenWidth : boolean
)

Parameters

  • scaleX
    Type: System.Single

    The factor to scale the X dimension of the ink in the view transform.

  • scaleY
    Type: System.Single

    The factor to scale the Y dimension of the ink in the view transform.

  • applyOnPenWidth
    Type: System.Boolean

    A value that indicates whether to apply the scale factors to the width of the drawing attributes of the ink in addition to the overall dimensions of the ink.

    Value

    Meaning

    true

    This method applies the scale factors to the pen width.

    false

    This method does not scale the pen width.

Remarks

When you pass true to the applyOnPenWidth parameter, the scaling occurs on the view transform. When you pass false to the applyOnPenWidth parameter, the scaling occurs on the object transform.

Examples

In this example, the GetObjectTransform is used to obtain the current object transform matrix from the Renderer object in an InkOverlay object. Then a scaling factor of 2 in both the X and Y dimensions is applied. Because false is passed to the applyOnPenWidth parameter, the width of the Ink is not scaled. Finally, the SetObjectTransform method is used to restore the original object transform.

' create a Matrix object and obtain the current object transform 
Dim origObjectTransform As Matrix = New Matrix()
mInkOverlay.Renderer.GetObjectTransform(origObjectTransform)
' scale the ink (without scaling the ink width)- this affects the object transform
mInkOverlay.Renderer.Scale(2.0F, 2.0F, False)
' later, you can restore the object transform back to the original
mInkOverlay.Renderer.SetObjectTransform(origObjectTransform)
// create a Matrix object and obtain the current object transform
Matrix origObjectTransform = new Matrix();
mInkOverlay.Renderer.GetObjectTransform(ref origObjectTransform);
// scale the ink (without scaling the ink width)- this affects the object transform
mInkOverlay.Renderer.Scale(2.0f, 2.0f, false);
// later, you can restore the object transform back to the original
mInkOverlay.Renderer.SetObjectTransform(origObjectTransform);

Platforms

Windows 7, Windows Vista, Windows Server 2008 R2, Windows Server 2008

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Version Information

.NET Framework

Supported in: 3.0

See Also

Reference

Renderer Class

Renderer Members

Scale Overload

Microsoft.Ink Namespace

Renderer.GetViewTransform

Stroke.Scale

Strokes.Scale