Gets or sets a value corresponding to amount of millimeters per one pixel.
Namespace:
CADImport
Assembly: CADImport (in CADImport.dll)
Syntax
Visual Basic (Declaration) |
Public Property MMToPixelX() As Double |
C#
|
public double MMToPixelX {get; set;} |
Example
<p>Example use MMToPixelX:</p>
<p>[C#]</p>
| Copy Code |
---|
public void SaveRealSizeImage(Control drawingControl)
{
Stream str = File.OpenRead(@".\test.dwg");
CADImage cadImage = new CADImport.DWG.DWGImage();
cadImage.LoadFromStream(str);
str.Close();
DRect tmpRect = new DRect(0, 0, 1, 1);
cadImage.SetNewMMToPixel(drawingControl.CreateGraphics());
double realScaleDouble = this.cadImage.AbsWidth / this.cadImage.MMToPixelX;
tmpRect.Width = tmpRect.Width * realScaleDouble;
tmpRect.Height = tmpRect.Height * realScaleDouble;
this.cadImage.SaveToFile(@"result.jpg", ImageFormat.Jpeg, tmpRect);
}
|
Platforms
Version Information
.NET Framework
Supported in: 2.0 - 4, NET6
.NET Framework Client Profile
Supported in: 4, 3.5 SP1
See Also