using CADImport;
using CADImport.DWG;
using CADImport.DXF;
using CADImport.RasterImage;
...
| C# | Copy Code |
|---|---|
private void Read_DWG_Click(object sender, EventArgs e)
{
//DWGImage class is used only for reading DWG. To read other
formatsuse the corresponding classes.
//E.g. for DXF: CADImage class, for PLT/HPGL: HPGLImage class.
DWGImage vDrawing = new DWGImage();
vDrawing.LoadFromFile(@"..\..\..\Files\Gasket.dwg");
vDrawing.Draw(Image1.CreateGraphics(), new RectangleF(0, 0,
(float)vDrawing.AbsWidth, (float)vDrawing.AbsHeight));
// zooming and panning of the drawing are implemented in the demo
Viewer
// via a special viewing control class CADPictureBox
} | |