内容导航
  • DWG2ImageX
产品标签
CAD

DWG2ImageX

一个转换DWG/DXF/DWF文件到GIF, JPEG, BMP, PNG图像格式的控件

以下是 "DWG2ImageX",如果您需要了解更多信息,您可以联系我们。

WG2ImageX是一个ActiveX,能够集成到你的应用程序中,实现DWG/DXF/DWF文件转换到我们常用的图像格式,如 GIF, JPEG, BMP, PNG,而且无需安装AutoCAD。

控件属性

  • InputFile Specify the file to be converted.
  • Width Set output image width in pixels.
  • Height Set output image height in pixels.
  • Background Set background of output image.
  • ImageFormat Set output image format.
  • ZoomType Set zoom type.
  • ViewCount Get the views count in the drawing file.
  • ViewName Get the view name by index.
  • ViewWidth Get the view width by index.
  • ViewHeight Get the view height by index.
  • Version Get version of the file.

控件方法

  • Convert Convert the drawing file to a Image file.
  • AddFontPath Add AutoCAD font support path.

支持版本

  • 从AutoCAD R9 文件到当前的AutoCAD 2012文件

支持语言

  • 任何支持 COM 技术的开发语言,如Visual C++, VB, Delphi, FoxPro, VBScript,JavaScript等

例子代码

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

Image