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

几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量 (http://www.dimcax.com/hust/index.php)
-   DirectDWG (http://www.dimcax.com/hust/forumdisplay.php?f=89)
-   -   【转帖】retrieving Thumbnailbitmap While Reading Dwg File (http://www.dimcax.com/hust/showthread.php?t=18455)

yang686526 2009-05-07 03:09 PM

【转帖】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">.


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