Printer.ScaleX Method

Converts the value for the width of a page from one of the units of measure of the ScaleMode property to another.

Namespace:  Microsoft.VisualBasic.PowerPacks.Printing.Compatibility.VB6
Assembly:  Microsoft.VisualBasic.PowerPacks.Vs (in Microsoft.VisualBasic.PowerPacks.Vs.dll)

Syntax

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

Parameters

  • value
    Type: System.Single

    Specify the number of units of measure to be converted.

  • fromScale
    Type: System.Int16

    Optional. A constant or value specifying the coordinate system from which the width of the object is to be converted. The possible values of fromScale are the same as those for the ScaleMode property.

  • toScale
    Type: System.Int16

    Optional. A constant or value specifying the coordinate system to which the width of the object is to be converted. The possible values of toScale are the same as those for the ScaleMode property.

Return Value

Type: System.Single
Returns a Single.

Remarks

The ScaleX and ScaleY methods take a value (width or height), with its unit of measure specified by fromScale, and convert it to the corresponding value for the unit of measure specified by toScale.

Note

Functions and objects in the Microsoft.VisualBasic.PowerPacks.Printing.Compatibility.VB6 namespace are provided for use by the tools for upgrading from Visual Basic 6.0 to Visual Basic. In most cases, these functions and objects duplicate functionality that you can find in other namespaces in the .NET Framework. They are necessary only when the Visual Basic 6.0 code model differs significantly from the .NET Framework implementation.

Examples

The following example demonstrates calling the ScaleX and ScaleY methods.

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 Security

See Also

Reference

Printer Class

Microsoft.VisualBasic.PowerPacks.Printing.Compatibility.VB6 Namespace

Other Resources

Printer Compatibility Library

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

Deploying Applications That Reference the Printer Compatibility Library