共用方式為


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