[ARX]请教预览功能怎么实现
autocad block命令中,对话框中有个预览功能,请问在arx中如何实现这种功能?谢谢!<br>实现的思路和方法是什么.<br>
<br> ..? 上次不是回答了你一个关于动态生成预览图的问题了么? 思路是一样的啊..
如果不想用BITMAP结构那么麻烦, 就直接建造临时块, 输出成.bmp再加载回来.. 本帖最后由 作者 于 2005-4-29 14:40:39 编辑
<P 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:
<PRE>HBITMAP hBitmap;
HPALETTE hPal;
acdbGetPreviewBitmapFromDwg("foo.dwg", &hBitmap, &hPal);
// Palette
CPalette* oldPal = pDC->SelectPalette(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><PRE>请问这段代码到底怎么用?单文档?要是对话框的怎么用呀</PRE>
页:
[1]