共用方式為


ScaleTransform Method (Automation Only)

ScaleTransform Method (Automation Only)

Applies the specified horizontal and vertical factors to the transform or ink.

Declaration

[C++]

HRESULT ScaleTransform(
    [in] float HorizontalMultiplier,
    [in] float VerticalMultiplier
);

[Microsoft® Visual Basic® 6.0]

Public Sub ScaleTransform( _
    HorizontalMultiplier As Single, _
    VerticalMultiplier As Single _
)

Parameters

HorizontalMultiplier

[in] The factor to scale the horizontal dimension in the transform.

VerticalMultiplier

[in] The factor to scale the vertical dimension in the transform.

Return Value

HRESULT value Description
S_OK Success.
E_INK_EXCEPTION An exception occurred inside the method.

Remarks

For the IInkStrokeDisp and InkStrokes classes, this method scales the points in the stroke or strokes relative to the origin. Thus, if the HorizontalMultiplier parameter is 2.0, the stroke or strokes will be twice as wide, and will also be twice as far, horizontally, from the origin. To control the relative position of the strokes, use this method in conjunction with the Move method.

Example

[Visual Basic 6.0]

This Visual Basic 6.0 example demonstrates a call to the ScaleTransform method on the strokes in the InkCollector, theInkCollector, when the command button Command1 is tapped, making the strokes collection 200% wider and 75% as tall as its original dimensions.

Option Explicit
Dim theInkCollector As InkCollector

Private Sub Command1_Click()
    theInkCollector.Ink.Strokes.ScaleTransform 2!, 0.75!
    Form1.Refresh
End Sub

Private Sub Form_Load()
    Set theInkCollector = New InkCollector
    theInkCollector.hWnd = Me.hWnd
    theInkCollector.Enabled = True
End Sub

Applies To