I am using CADImport .NET professional and I'm having problems exporting a CADImport.DWGImage to a Stream in bitmap format. The code I use is roughly:
Code: Select all
CADImport.DRect ext = new CADImport.DRect(
0, 0, 0,
__loaded.AbsWidth, __loaded.AbsHeight, 0);
__loaded.SaveToStream(__imageStream, System.Drawing.Imaging.ImageFormat.Bmp,
ext);
where __loaded is a DWGImage and __imageStream is a MemoryStream. My problem is for some files I get a invalid parameters exception, for others the file renders but not completely (some blocks are left out). I've tried various ways of constructing the DRect which I need to feed to the SaveToStream procedure (including the Extents property of the image), but results are inconsistent, and the documentation for this feature is vague at best.
Your CAD Viewer component seems to be able to load the files correctly. Could you kindly point me to some documentation, code example, or explain how I can export CAD Images completely and correctly to a raster stream?
Thank You