Renderer.Scale 方法 (Single, Single)

在 X 和 Y 维度缩放 GetViewTransform。缩放因子应用于墨迹的绘制属性的宽度。

命名空间:  Microsoft.Ink
程序集:  Microsoft.Ink(在 Microsoft.Ink.dll 中)

语法

声明
Public Sub Scale ( _
    scaleX As Single, _
    scaleY As Single _
)
用法
Dim instance As Renderer
Dim scaleX As Single
Dim scaleY As Single

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

参数

  • scaleX
    类型:System.Single
    墨迹 在视图变换中的 X 维度缩放因子。
  • scaleY
    类型:System.Single
    墨迹在视图变换中的 Y 维度缩放因子。

备注

此重载会将缩放因子自动应用到墨迹的绘制属性的宽度。若要选择是否将缩放因子应用到墨迹的宽度,请使用此方法的 Scale(Single, Single, Boolean) 重载。

示例

在此示例中,GetViewTransform 用于从 InkOverlay 对象中的 Renderer 对象获取当前视图变换矩阵。然后在 X 和 Y 维度中应用缩放因子 2。最后,使用 SetViewTransform 方法还原原始视图变换。

' create a Matrix object and obtain the current view transform
Dim origViewTransform As Matrix = New Matrix()
mInkOverlay.Renderer.GetViewTransform(origViewTransform)
' scale the ink - this affects the view transform
mInkOverlay.Renderer.Scale(2.0F, 2.0F)
' later, you can restore the view transform back to the original
mInkOverlay.Renderer.SetViewTransform(origViewTransform)
// create a Matrix object and obtain the current view transform
Matrix origViewTransform = new Matrix();
mInkOverlay.Renderer.GetViewTransform(ref origViewTransform);
// scale the ink - this affects the view transform
mInkOverlay.Renderer.Scale(2.0f, 2.0f);
// later, you can restore the view transform back to the original
mInkOverlay.Renderer.SetViewTransform(origViewTransform);

平台

Windows Vista

.NET Framework 和 .NET Compact Framework 并不是对每个平台的所有版本都提供支持。有关支持的版本的列表,请参见.NET Framework 系统要求

版本信息

.NET Framework

受以下版本支持:3.0

另请参见

参考

Renderer 类

Renderer 成员

Scale 重载

Microsoft.Ink 命名空间

Renderer.GetViewTransform

Stroke.Scale

Strokes.Scale