- 积分
- 909
- 明经币
- 个
- 注册时间
- 2005-4-1
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
发表于 2005-4-28 19:06:00
|
显示全部楼层
本帖最后由 作者 于 2005-4-29 14:40:39 编辑
< class=signature>bool acdbGetPreviewBitmapFromDwg( const char* pszDwgfilename, HBITMAP* pPreviewBmp, HPALETTE* pRetPal);
pszDwgfilename The DWG file name that you want to get the preview bitmap from. pPreviewBmp Returned bitmap from the DWG. pRetPal Returned palette used to draw the bitmap correctly.This function returns the preview bitmap from a DWG file.
The following sample shows how to use this function:
<RE>HBITMAP hBitmap;
HPALETTE hPal;
acdbGetPreviewBitmapFromDwg("foo.dwg", &hBitmap, &hPal);
// Palette
CPalette* oldPal = [U]pDC->SelectPalette([/U]CPalette::FromHandle(hPal),TRUE);
pDC->RealizePalette();
CBitmap bm;
bm.Attach(hBitmap);
CDC dcMem;
dcMem.CreateCompatibleDC(pDC);
CBitmap *pOldBitmap = dcMem.SelectObject(&bm);
pDC->BitBlt(0, 0, 1000,1000, &dcMem, 0, 0, SRCCOPY);
dcMem.SelectObject(pOldBitmap);
pDC->SelectPalette(oldPal,TRUE );
pDC->RealizePalette();
bm.DeleteObject();
DeleteObject(hBitmap);
DeleteObject(hPal);</PRE><RE>请问这段代码到底怎么用?单文档?要是对话框的怎么用呀</PRE> |
|