CAD从二制流数据中加载图形(com接口)

主要用到函数说明:


_DMxDrawX::ReadBinStream


从二制流数据中加载图形,详细说明如下:


参数 说明

VARIANT varBinArray

二制流数据,是个byte数组

BSTR sPassword

图纸密码.没有密码,传空字符串

LONG lReadContent

加载内容,如果全部加载,传16777215,十六进制0xFFFFFF


c#代码实现如下:


1
2
3
4
5
6
7
8
9
string sFileName = "G:\12345.dwg";                    //axMxDrawX1.SaveDwgFile(sFileName);
 
FileStream fileStream = new FileStream(sFileName, FileMode.Open, FileAccess.Read);
BinaryReader binaryReader = new BinaryReader(fileStream);
byte[] mybyte = binaryReader.ReadBytes((int)fileStream.Length);
 
axMxDrawX1.NewFile();
 
axMxDrawX1.ReadBinStream(mybyte, "", 16777215);

posted on 2019-06-11 10:38  梦想CAD控件  阅读(121)  评论(0)    收藏  举报

导航