- UID
- 1
- 积分
- 16111
- 精华
- 贡献
-
- 威望
-
- 活跃度
-
- D豆
-
- 在线时间
- 小时
- 注册时间
- 2002-1-3
- 最后登录
- 1970-1-1
|
发表于 2002-3-14 10:29:08
|
显示全部楼层
使用acdbDisplayPreviewFromDwg(....)
- bool acdbDisplayPreviewFromDwg(
- const char *pszDwgfilename,
- void* pPreviewWnd,
- const Adesk::UInt32* pBgColor = NULL);
-
- where:
- pszDwgfilename Input path\filename string
- pPreviewWnd Input HWND for window within which to display preview
- pBgColor Input unsigned 32 bit integer for background color,
- default to NULL.
复制代码
给你个资料(附完整的代码),如何在用MFC显示DWG的预演。
How to display a DWG preview using an MFC function?
ID 5298
Applies to: AutoCAD 2000
AutoCAD 2000I
AutoCAD 2002
Date 1/22/2002
This document is part of ObjectARX DWG File MFC
Question
How can I implement a function using the Microsoft Foundation Classes (MFC) to
display a drawing preview?
Answer
With ObjectARX and MFC, you can use the API function acdbDisplayPreviewFromDwg()
to display the dwg preview image over a place holder.
To do this, you need to make the place holder a similar size as the size of the
preview image in the AutoCAD Open dialog. The placeholder is of a picture frame
type of control in Visual C++.
This is so that the preview image is saved based on the viewport window's client
size. Users can resize the AutoCAD window on the desktop; as a result, the
bitmap image is saved in different sizes.
The attached sample shows how to do this and it also allows you to browse to
different dwgs.
Alternative methods are to use the DwgThumbnail OCX control, which provides
better sizing control and background color control, or you can read the dwg
bitmap information directly. For more information, see DevNote #2028. |
|