次の方法で共有


Renderer.Scale メソッド (Single, Single, Boolean)

X 次元および Y 次元の GetViewTransform をスケーリングします。applyOnPenWidth パラメータに false を渡すことによって、インクの描画属性の幅にスケール ファクタが適用されない場合、代わりに、スケーリングは GetObjectTransform で行われます。

名前空間 :  Microsoft.Ink
アセンブリ :  Microsoft.Ink (Microsoft.Ink.dll 内)

構文

'宣言
Public Sub Scale ( _
    scaleX As Single, _
    scaleY As Single, _
    applyOnPenWidth As Boolean _
)
'使用
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 void Scale(
    float scaleX,
    float scaleY,
    boolean applyOnPenWidth
)
public function Scale(
    scaleX : float, 
    scaleY : float, 
    applyOnPenWidth : boolean
)

パラメータ

  • scaleX
    型 : System.Single
    ビュー変換においてインクの X 次元をスケーリングするファクタ。
  • scaleY
    型 : System.Single
    ビュー変換においてインクの Y 次元をスケーリングするファクタ。
  • applyOnPenWidth
    型 : System.Boolean
    スケール ファクタを、インクのすべての次元に加えてインクの描画属性の幅に適用するかどうかを示す値。

    説明

    true

    このメソッドは、スケール ファクタをペンの幅に適用します。

    false

    このメソッドは、ペンの幅をスケーリングしません。

解説

applyOnPenWidth パラメータに true を渡すと、スケーリングはビュー変換で行われます。applyOnPenWidth パラメータに false を渡すと、スケーリングはオブジェクト変換で行われます。

この例では、GetObjectTransform を使用して InkOverlay オブジェクトにある Renderer オブジェクトから現在のオブジェクト変換行列を取得します。次に、X および Y の両方向に対して、スケール ファクタ 2 が適用されます。applyOnPenWidth パラメータに false が渡されているため、インクの幅はスケーリングの対象になりません。最後に、SetObjectTransform メソッドを使用して元のオブジェクト変換が復元されます。

' 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);

プラットフォーム

Windows Vista

.NET Framework および .NET Compact Framework では、各プラットフォームのすべてのバージョンはサポートしていません。サポートされているバージョンについては、「.NET Framework システム要件」を参照してください。

バージョン情報

.NET Framework

サポート対象 : 3.0

参照

参照

Renderer クラス

Renderer メンバ

Scale オーバーロード

Microsoft.Ink 名前空間

Renderer.GetViewTransform

Stroke.Scale

Strokes.Scale