查看单个帖子
旧 2009-04-16, 12:39 PM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】[arx]请教预览功能怎么实现

[arx]请教预览功能怎么实现
[arx]请教预览功能怎么实现
autocad block命令中,对话框中有个预览功能,请问在arx中如何实现这种功能?谢谢!
实现的思路和方法是什么.
..? 上次不是回答了你一个关于动态生成预览图的问题了么? 思路是一样的啊..
如果不想用bitmap结构那么麻烦, 就直接建造临时块, 输出成.bmp再加载回来..
virtue is like a rich stone, best plain set.
-- francis bacon, <of beauty>
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:
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);
请问这段代码到底怎么用?单文档?要是对话框的怎么用呀
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)