主要用到函数说明:

_DMxDrawX::WriteBinStream

把控件图形变成二进制流输出,详细说明如下:

VARIANT* pVarBinArray

输出二进制数组.是个byte数组

BSTR sPassword

数据密码,没有密码,传空字符串

LONG iVersion

输出的文件版本,如果保存CAD 2002图纸,可以传 23

代码实现如下:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
Dim aryData     As Variant
MxDrawX1.WriteBinStream aryData, "", 23
 
Dim ln As Long
ln = UBound(aryData)
 
ReDim sbyte(0 To ln) As Byte
 
Dim str$
For i = 0 To ln
    sbyte(i) = aryData(i)
    'str = str & " " & (aryData(i))
Next
 
'MsgBox str
 
'MxDrawX1.ReadBinStream aryData, "", 16777215
 
MxDrawX1.ReadBinStream sbyte, "", 16777215
05-11 13:12