以下是 "DWG2ImageX",如果您需要了解更多信息,您可以联系我们。
WG2ImageX是一个ActiveX,能够集成到你的应用程序中,实现DWG/DXF/DWF文件转换到我们常用的图像格式,如 GIF, JPEG, BMP, PNG,而且无需安装AutoCAD。
Dim objImage
On Error Resume Next
Set objImage= CreateObject("dwg2imageX.Converter")
objImage.Width = 1024
objImage.Height = 768
objImage.ImageFormat = 2 '1--jpeg, 2--gif
objImage.InputFile = "c:\My Drawings\8th floor furniture.dwg"
MsgBox objImage.Version 'Get the drawing file version.
MsgBox "Total "& objImage.ViewCount &" Views"
For I=1 to objImage.ViewCount
strViewName = objImage.ViewName(I)
MsgBox "Converting view: "& strViewName& "..."
nWidth = objImage.ViewWidth(I)
nHeight= objImage.ViewHeight(I)
MsgBox "Width="&nWidth&" Height="&nHeight
strOutput = "c:\Output\"&strViewName
objImage.Convert strOutput, strViewName
Next
If Err.Number < 0 Then
MsgBox Err.Description
End If