|
Description
|
Returns/sets a value indicating the unit of measurement for coordinates of a picture.
|
Syntax Visual Basic
|
[form.]DXFReader.PictureScaleMode[ = PictureScaleModeEnum]
|
|
Visual C++
|
long DXFReader.GetPictureScaleMode(); void DXFReader.SetPictureScaleMode(long nNewValue);
|
|
Delphi
|
property PictureScaleMode: TOleEnum (PictureScaleModeEnum);
|
|
C#
|
|
|
Remarks
|
Valid settings for the PictureScaleMode property are:
| 0 | User | User defined | | 1 | Twip | 1 picture inch = 1440 drawing units (1440 twips per logical inch; 567 twips per logical centimeter) | | 2 | Point | 1 picture inch = 72 drawing units (72 points per logical inch) | | 3 | Pixel | 1 picture pixel = 1 drawing unit | | 4 | Character | 1 horizontal picture inch = 12 drawing units, 1 vertical picture inch = 6 drawing units (horizontal = 120 twips per unit; vertical = 240 twips per unit) | | 5 | Inch | 1 picture inch = 1 drawing unit | | 6 | Millimeter | 1 picture millimeter = 1 drawing unit | | 7 | Centimeter | 1 picture centimeter = 1 drawing unit |
The PictureScaleMode property is used to scale the background picture loaded in the control. To understand how this property works let's examine the following picture:

This picture is a bitmap image 200 x 200 Pixels size. It has 37.87 pixels per centimeter so its size in different units are:
| 5.28 x 5.28 | centimeters | | 52.8 x 52.8 | millimeters | | 2.08 x 2.08 | inchs | | 2995.20 x 2995.20 | twips | | 149.76 x 149.76 | points | | 24.96 x 12.48 | characters |
The figure below shows a DXFReader control displaying a simple drawing containing a square with 200 x 200 units size and its lower-left corner with coodinates (0,0), and a circle with center in (100,100) and radius of 100.

Setting PictureScaleMode = Pixel every single pixel of the picture will be one drawing unit long so the code below will show the following picture:
With DXFReader1
.PictureScaleMode = Pixel .Picture = LoadPicture("Picture.bmp") .ReadDXF "Drawing.dxf"
End With

The particular below shows the previous picture zoomed near the axes origin and with the ShowAxes property setted to true.

You can see that every pixel is one drawing units long. The following figures show the differences of the scaling modes.
 PictureScaleMode = Millimeter
 PictureScaleMode = Centimeter
 PictureScaleMode = Inch
 PictureScaleMode = Twip
 PictureScaleMode = Point
 PictureScaleMode = Character
Setting PictureScaleMode = User the picture is scaled according the PictureScaleX, PictureScaleY, PictureHeight and PictureWidth properties. The code below will show the following picture:
With DXFReader1
.PictureScaleMode = User .Picture = LoadPicture("Picture.bmp") .ReadDXF "Drawing.dxf" .PictureScaleX = 1 .PictureScaleY = 1 .PictureHeight = 100 .PictureWidth = 100
End With
|
|
Data Type
|
PictureScaleModeEnum (Enumeration)
|
|
Default Value
|
Pixel (3)
|