See Also Example
Applies To
Form, picture box
Description
Determines the unit of measurement for coordinates of an object when using graphics methods
Usage
{ [form.][picturebox.]|Printer.}ScaleMode[ = mode ]
Setting
The ScaleMode property settings are:
Setting Description
0 Indicates that one or more of the ScaleHeight, ScaleWidth , ScaleLeft, and ScaleTop properties are set to custom values.
1 (Default) Twip (1440 twips per logical inch; 567 twips per logical centimeter).
2 Point (72 points per logical inch).
3 Pixel (smallest unit of monitor or printer resolution).
4 Character (horizontal = 120 twips per unit; vertical = 240 twips per unit).
5 Inch.
6 Millimeter.
7 Centimeter.
Remarks
Using the related ScaleHeight, ScaleWidth 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.
Setting ScaleMode to a number greater 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 will change to reflect the new coordinates of the current point.
Data Type
Integer (Enumerated)
Help:
DrawMode Property
DrawStyle Property
FillColor Property
ForeColor Property
Scale Method
ScaleHeight, ScaleWidth Properties
ScaleLeft, ScaleTop Properties
Programmer's Guide:
Chapter 15, "Creating Graphics for Applications"
Chapter 16, "Displaying and Printing Information"
The example shows how different ScaleMode property settings change the size of a circle. To try this example, paste the code into the Declarations section of a form. Then press F5 and click the form. When you click the form, the unit of measurement changes to the next ScaleMode setting and a circle is drawn on the form.
Sub Form_Click ()
' Cycle through each of 7 ScaleModes.
ScaleMode = ((ScaleMode + 1) Mod 7) + 1
' Draw a circle with radius of 2 in center of form.
Circle (ScaleWidth / 2, ScaleHeight / 2), 2
End Sub