Printer.ScaleMode Property

Gets or sets a value indicating the unit of measurement for the coordinates of an object when you are using graphics methods.

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

Syntax

'Declaration
Public Property ScaleMode As Short
public short ScaleMode { get; set; }
public:
property short ScaleMode {
    short get ();
    void set (short value);
}
member ScaleMode : int16 with get, set
function get ScaleMode () : short 
function set ScaleMode (value : short)

Property Value

Type: System.Int16
Returns a Short.

Remarks

By using the related ScaleHeight, ScaleWidth, ScaleLeft, and ScaleTop properties, you can create a custom coordinate system with both positive and negative coordinates. These four scale properties interact with the ScaleMode property in the following ways:

  • Setting the value of any other scale property to any value automatically sets ScaleMode to 0. A ScaleMode of 0 is user-defined.

Setting the ScaleMode property to a number larger than 0 changes ScaleHeight and ScaleWidth to the new unit of measurement and sets ScaleLeft and ScaleTop to 0. The CurrentX and CurrentY property settings change to reflect the new coordinates of the current point.

The following table lists the ScaleModeConstants values that are valid for the ScaleMode property.

Constant

Value

Description

vbUser

0

Indicates that one or more of the ScaleHeight, ScaleWidth, ScaleLeft, and ScaleTop properties are set to custom values.

vbTwips

1

Twip (1440 twips per inch; 567 twips per centimeter). (This is the default.)

vbPoints

2

Point (72 points per logical inch).

vbPixels

3

Pixel (smallest unit of monitor or printer resolution).

vbCharacters

4

Character (horizontal = 120 twips per unit; vertical = 240 twips per unit).

vbInches

5

Inch.

vbMillimeters

6

Millimeter.

vbCentimeters

7

Centimeter.

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 how to set the ScaleMode property, drawing a circle for each ScaleMode value.

Dim Printer As New Printer
Dim i As Integer
For i = 1 To 6
    Printer.ScaleMode = Printer.ScaleMode + 1
    Printer.Circle(Printer.ScaleWidth / 2, Printer.ScaleHeight / 2, 5)
Next i
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