我就要吐血啦! 请问怎么把一个显示在屏幕上的矢量图(cad 的dwg文件)转换成位图,或jpg再(150分)

V

vericky

Unregistered / Unconfirmed
GUEST, unregistred user!
就要吐血啦! 请问怎么把一个显示在屏幕上的矢量图(cad 的dwg文件)转换成位图,或jpg再
把它存起来? 给些建议和源代码看看吧,毕设期限在即,一无头绪啊!
 
拷贝屏幕不行吗?
 
不好意思,要用程序来完成, 我觉得应该

有这种方法。
 
>> 提前!不信没有高手会 !
 
编程提取DWG图形数据

有几种方式可以实现。

使用ARX API函数:
Adesk::Boolean
acdbDisplayPreviewFromDwg(const char *pszDwgfilename, void *pPreviewWnd)


使用ActiveX Automation接口:
R14支持ActiveX Automation,增加DWGThumbnail控件,使得在VB/VBA中能够浏览R14/R13的DWG文件。


使用Autodesk提供的DwgX Control
DwgX Control提供了更为广泛的Automation API函数,甚至能够象DWG Unplugged的开发者一样,访问DWG文件的格式得到AcDbDatabase *s的数据。利用DwgX Control显示的是DWG文件内容而不仅仅是预览的光栅图象。当然,DwgX Control必须需要Autodesk View1.2以上版本,已经正确安装,并且在后台运行。这一工具,用户可以在http://www.autodesk.com网页上自由下载。

 
内寸中开辟一块,同时绘图
 
使用ActiveX Automation接口对AutoCAD直接进行操作即可
 
同意shaofun,用automation,
用导出函数Export。下面是autoCAD中的帮助:
Applies To
Document

Description

Exports the AutoCAD drawing to a SAT, WMF, EPS, DXF, and BMP formats.

Syntax

object.Export(Filename, Extension, SelectionSet)

Elements

Filename String; input-only
The name for the newly exported file

Extension String; input-only
This string should contain three characters specifying the type of file to export the drawing into. Case is not important. Use one of the following extensions:
SAT, WMF, EPS, DXF, BMP, or 3DS.
SelectionSet SelectionSet; input-only
Export only the objects in the specified selection set. The selection set cannot be empty. If NULL, the entire drawing is exported.

Return Value
None
下面的会了吧!
 
多人接受答案了。
 
上面的人真是弱智,SelectionSet哪来的,要用户自己选择吗?
 

Similar threads

S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
I
回复
0
查看
564
import
I
I
回复
0
查看
496
import
I
顶部