如何把控件图形变成二进制流输出?
VB开发|黄洪辉|2018-05-30 11:03
-
回答:
主要用到函数说明:
_DMxDrawX::WriteBinStream
把控件图形变成二进制流输出,详细说明如下:
参数 说明 VARIANT* pVarBinArray
输出二进制数组.是个byte数组
BSTR sPassword
数据密码,没有密码,传空字符串
LONG iVersion
输出的文件版本,如果保存CAD 2002图纸,可以传 23
代码实现如下:
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