几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量  


返回   几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量 » 仿射空间:CAX软件开发(三)二次开发与程序设计 » CAD二次开发 » AutoCAD二次开发 » DirectDWG
用户名
密码
注册 帮助 会员 日历 银行 搜索 今日新帖 标记论坛为已读


 
 
主题工具 搜索本主题 显示模式
旧 2009-05-05, 09:37 AM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】error in export to bmp

error in export to bmp
error in export to bmp
i'm trying to export a dwg a bmp but he only managed to get a file with the black screen. he looked the example cmd_bmpout.cpp although neither he managed to find the option to run from odamfcappdll.
quote:
bool dwgdocument::savebmp() const
{
odstring spmpt;
odgsmoduleptr pgs = :drxdynamiclinker()->loadmodule(l"winopengl_2.05_8.gs", false);
odgsdeviceptr pdevice = pgs->createbitmapdevice();
oddbdatabaseptr pdb(pdbdocument_);
odgicontextfordbdatabaseptr pctx = odgicontextfordbdatabase::createobject();
pctx->setdatabase(pdb);
pdevice = oddbgsmanager::setupactivelayoutviews(pdevice, pctx);
//pdevice = oddbgsmanager::setupactivelayoutviews(pdevice, pctx);
//odabstractviewpeptr pdeviceview;
//odgsviewptr pdv;
//odrxobjectptr playoutview;
//if (!pdbdocument_->gettilemode())
//{ // paper space
// pdv = odgspaperlayouthelperptr(pdevice)->overallview();
// pdeviceview = pdv;
// oddblayoutptr playout = pdbdocument_->currentlayoutid().safeopenobject();
// oddbobjectid overallvpid = playout->overallvportid();
// oddbviewportptr pactivevp = overallvpid.safeopenobject();
// playoutview = pactivevp;
//}
//else
//{ // model space
// pdv = odgsmodellayouthelperptr(pdevice)->activeview();
// pdeviceview = pdv;
// oddbviewporttableptr pvpt = pdbdocument_->getviewporttableid().safeopenobject();
// oddbviewporttablerecordptr pactivevp = pvpt->getactiveviewportid().safeopenobject();
// playoutview = pactivevp;
//}
//// get extents from current layout
//odgeboundblock3d bbox;
//odabstractviewpeptr playoutviewpe(playoutview);
//playoutviewpe->viewextents(playoutview, bbox);
//pdeviceview->zoomextents(pdv, &bbox);
int ncolorbits = 32;
pdevice->properties()->putat("bitperpixel", odrxvariantvalue(oduint32(ncolorbits)));
pdevice->setbackgroundcolor(odrgb(173,174,173)); // acad's color for paper bg, "device background"
odcolorref bg = odrgb(255,255,255); // palette background
pctx->setpalettebackground(bg);
const odcolorref* palette = odcmacadpalette(bg);
odgspalette ppalcpy;
ppalcpy.insert(ppalcpy.begin(), palette, palette+256);
ppalcpy[0] = bg;
pdevice->setlogicalpalette(ppalcpy.asarrayptr(), 256);
int xsize = 2000;
int ysize = 2000;
odgsdcrect gsrect(0, xsize, ysize, 0 );
pdevice->onsize(gsrect);
pctx->setplotgeneration( 1);
//if(pctx->isplotgeneration())
// pdevice->setbackgroundcolor(bg);
//else
pdevice->setbackgroundcolor(odrgb(255,255,255)); // acad's color for paper bg, "device background"
pdevice->update();
savebitmap( odgirasterimageptr(pdevice->properties()->getat("rasterimage")), "d:\prueba.bmp" );
return true;
}
thx carlos calvo
i changed the module "winopengl_2.05_8.gs" by that other "wingdi_2.05_8.gs" and now if i generated correctly. "bmp"
why can this be?
in the example application odamfcappdll is the same...
thx carlos calvo
not all devices support 32 bit per pixel bmp format.
you get an exception from properties()->putat() ?
btw: sources for gs devices are available and you step into putat() in debugger.
sergey slezkin
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)
 


主题工具 搜索本主题
搜索本主题:

高级搜索
显示模式

发帖规则
不可以发表新主题
不可以回复主题
不可以上传附件
不可以编辑您的帖子

vB 代码开启
[IMG]代码开启
HTML代码关闭

相似的主题
主题 主题发起者 论坛 回复 最后发表
【转帖】dwf export problem yang686526 DirectDWG 0 2009-05-04 08:19 PM
【转帖】bmp export and whitespace yang686526 DirectDWG 0 2009-05-04 04:54 PM
【转帖】any dwg to bmp export command line programsample code yang686526 DirectDWG 0 2009-05-04 04:03 PM
vlisp-export-symbol用法及作用是什么? yang686526 ObjectARX(AutoLISP) 0 2009-04-25 09:25 PM
【转帖】custom export options yang686526 SolidWorks二次开发 0 2009-04-13 10:07 AM


所有的时间均为北京时间。 现在的时间是 07:10 PM.


于2004年创办,几何尺寸与公差论坛"致力于产品几何量公差标准GD&T | GPS研究/CAD设计/CAM加工/CMM测量"。免责声明:论坛严禁发布色情反动言论及有关违反国家法律法规内容!情节严重者提供其IP,并配合相关部门进行严厉查处,若內容有涉及侵权,请立即联系我们QQ:44671734。注:此论坛须管理员验证方可发帖。
沪ICP备06057009号-2
更多