Unit-Aware Lengths
The default unit of measurement for all coordinates and sizes of a C1PrintDocument object is set by the DefaultUnit property. For example, if you set the DefaultUnit to C1.C1PrintDocument.UnitTypeEnum.Inch, setting the Width of an object to 2 will make it 2 inches wide. But, all coordinates and sizes can also be set with explicit specification of unit. For this, all such properties have a twin property with the Str suffix, for example WidthStr, which allows you to set the property to a string containing the (case-insensitive) unit specification. For example, the following code sets the width in twips:
o.WidthStr = "1440tw"
• C#
o.WidthStr = "1440tw";
Actually, all unit-aware lengths are stored in a special type, Unit, which provides various utility methods for handling such values, and the properties discussed above are shortcuts to methods of that type.
There are also complex classes such as UnitRectangle, UnitSize, and UnitPoint, which provide commonly used combinations of the Unit type.
Percentage Unit of Measurement
|