在 X 和 Y 維度中縮放 GetViewTransform。如果筆墨繪圖屬性的寬度未套用縮放比例 (即傳遞 false 至 applyOnPenWidth 參數),則會使 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
這個方法不會縮放畫筆寬度。
備註
當您將 true 傳遞至 applyOnPenWidth 參數時,會使檢視轉換發生縮放,而將 false 傳遞至 applyOnPenWidth 參數時,會使物件轉換發生縮放。
範例
在這個範例中,會使用 GetObjectTransform,以便從 InkOverlay 物件中的 Renderer 物件取得目前物件轉換矩陣。然後會同時在 X 和 Y 維度中套用縮放比例 2。因為 false 傳遞至 applyOnPenWidth 參數,所以筆墨的寬度未縮放。最後會使用 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