共用方式為


Printer.ScaleY 方法

將頁面的高度值從 ScaleMode 屬性的其中一個測量單位轉換為另一個測量單位。

命名空間:  Microsoft.VisualBasic.PowerPacks.Printing.Compatibility.VB6
組件:  Microsoft.VisualBasic.PowerPacks.Vs (在 Microsoft.VisualBasic.PowerPacks.Vs.dll 中)

語法

'宣告
Public Function ScaleY ( _
    value As Single, _
    fromScale As Short, _
    toScale As Short _
) As Single
public float ScaleY(
    float value,
    short fromScale,
    short toScale
)
public:
float ScaleY(
    float value, 
    short fromScale, 
    short toScale
)
member ScaleY : 
        value:float32 * 
        fromScale:int16 * 
        toScale:int16 -> float32
public function ScaleY(
    value : float, 
    fromScale : short, 
    toScale : short
) : float

參數

  • value
    類型:Single

    指定要轉換的測量單位的數量。

  • fromScale
    類型:Int16

    選擇項。 指定座標系統的常數或值,物件的高度要從這個座標系統進行轉換。 fromScale 的可能值與 ScaleMode 屬性的可能值相同。

  • toScale
    類型:Int16

    選擇項。 指定座標系統的常數或值,物件的高度要轉換到這個座標系統。 toScale 的可能值與 ScaleMode 屬性的可能值相同。

傳回值

類型:Single
傳回 Single。

備註

ScaleX 和 ScaleY 方法會採用值 (寬度或高度),而它的測量單位指定的 fromScale,並將其轉換為 toScale指定的度量單位的對應值。

注意事項注意事項

Microsoft.VisualBasic.PowerPacks.Printing.Compatibility.VB6 命名空間中的函式和物件都是供這些工具使用,以便從 Visual Basic 6.0 升級至 Visual Basic。在大多數情況下,這些函式和物件會複製在 .NET Framework 的其他命名空間中可以找到的功能。只有當 Visual Basic 6.0 程式碼模型與 .NET Framework 實作有顯著差異時,才需要這些項目。

範例

下列範例示範呼叫 ScaleX 和 ScaleY 方法。

Dim Printer As New Printer
Printer.ScaleX(Printer.Width, vbTwips, vbInches)
Printer.ScaleY(Printer.Height, vbTwips, vbInches)
Printer.DrawStyle = vbSolid
Printer.Line(1, 1, 4, 4, vbRed, True)
Printer.EndDoc()

.NET Framework 安全性

請參閱

參考

Printer 類別

Microsoft.VisualBasic.PowerPacks.Printing.Compatibility.VB6 命名空間

其他資源

Printer Compatibility Library

How to: Fix Upgrade Errors by Using the Printer Compatibility Library (Visual Basic)

Deploying Applications That Reference the Printer Compatibility Library