查看单个帖子
旧 2009-05-07, 03:09 PM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】retrieving Thumbnailbitmap While Reading Dwg File

retrieving thumbnailbitmap while reading dwg file
retrieving thumbnailbitmap while reading dwg file
hai,
i have checked with posts which are already available related with retrieving thumbnailbitmap.it is working while writing dwg file with option.then i am able to retrieve thumbnailbitmnap.
oddbdatabaseptr dbptr = svcs.createdatabase();
dbptr->setretainoriginalthumbnailbitmap(true);
oddb::savetype filetype = oddb::kdwg;
oddb:: dwgversion outver = oddb::vac18;
const char* file("d:\\bmptest.dwg");
dbptr->writefile(file,filetype,outver,true);
oduint32 length;
dbptr->thumbnailbitmap(length);
here length has non zero value. the above code is working fine while writing dwg file.
i need to retrieve the thuhmbnailbitmap from already available dwg file while reading.(make dwg file with few entities,i have attached file)i am using following code.
oddbdatabaseptr pdb;
pdb = svcs.createdatabase(false);
pdb->setretainoriginalthumbnailbitmap(true);
pdb = svcs.readfile("d:\\test.dwg",true, false, oda::ksharedenyno);
oduint32 length;
pdb->thumbnailbitmap(length);
i am always getting as zero length.can anyone help.
thanks in advance.
regards,
petchi muthu
attached files
dear friends,
here is the answer,
there are two ways you can get the preview.
(1)
oduint32 datalength;
oddbdatabadatalengthseptr pmdatabase;
pdb= svs.createdatabase(false);
pd->setretainoriginalthumbnailbitmap(true);
pd->readfile(odstring(acadfile), false, oda::ksharedenyno);
pmimage = (odthumbnailimage*)pmdatabase->thumbnailbitmap(datalength);
(2)
odstreambufptr buf = svs.createfile(file);
odthumbnailimage image;
oddbgetpreviewbitmap(buf, &image);
regards,
petchi muthu
last edited by petchi_muthu_t; 1st december 2006 at 07:55 amfff">.
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)