![]() |
【转帖】raster image lis
raster image list
raster image list howdy, i'm trying to take a list of raster images for the drawing. could somebody explain me how i can get a raster image dictionary object? any examples, parts of code, or links will be helpful. thanks here it is: oddbdatabaseptr pdb; <put database loading code here> oddbdictionaryptr pimagedict; oddbobjectid imagedictid = oddbrasterimagedef::imagedictionary( pdb ); if( !imagedictid.isnull() ) pimagedict = imagedictid.safeopenobject( oddb::kforread ); if( pimagedict.get() ) { <...dictionary ready for reading...> } ------------- mark thanks you, marco. i didn't call pimagedict.get(). now it's working fine. thanks again. quote: originally posted by marco cocco here it is: oddbdatabaseptr pdb; <put database loading code here> oddbdictionaryptr pimagedict; oddbobjectid imagedictid = oddbrasterimagedef::imagedictionary( pdb ); if( !imagedictid.isnull() ) pimagedict = imagedictid.safeopenobject( oddb::kforread ); if( pimagedict.get() ) { <...dictionary ready for reading...> } ------------- mark sorry, i'm new here. could you tell how to read dictionary to get raster file path info? thanks. quote: originally posted by marco cocco here it is: oddbdatabaseptr pdb; <put database loading code here> oddbdictionaryptr pimagedict; oddbobjectid imagedictid = oddbrasterimagedef::imagedictionary( pdb ); if( !imagedictid.isnull() ) pimagedict = imagedictid.safeopenobject( oddb::kforread ); if( pimagedict.get() ) { <...dictionary ready for reading...> } ------------- mark if you want to get all raster images: code: oddbobjectid imagedictid = oddbrasterimagedef::imagedictionary( pdb ); if( !imagedictid.isnull() ) { oddbdictionaryptr pimagedict = imagedictid.safeopenobject( oddb::kforread ); oddbdictionaryiteratorptr piter = pimagedict->newiterator(); while (!piter->done()) { odstring strimagename = piter->name(); oddbrasterimagedefptr pimagedef = piter->getobject(); odstring strfilename = pimagedef->sourcefilename(); piter->step(); } } sergey slezkin thank you very much, sergey. one thing to be corrected. it should be piter->next() instead of piter->step() for oddbdictionaryiteratorptr. am i right? thanks again. quote: originally posted by sergey slezkin if you want to get all raster images: code: oddbobjectid imagedictid = oddbrasterimagedef::imagedictionary( pdb ); if( !imagedictid.isnull() ) { oddbdictionaryptr pimagedict = imagedictid.safeopenobject( oddb::kforread ); oddbdictionaryiteratorptr piter = pimagedict->newiterator(); while (!piter->done()) { odstring strimagename = piter->name(); oddbrasterimagedefptr pimagedef = piter->getobject(); odstring strfilename = pimagedef->sourcefilename(); piter->step(); } } please ignore this message. my mistake. but i cannot delete it sorry to bother again. i test the code with attached dwg file. i got "strimagename"s for the two raster files, but "strfilename"s are empty string for both of them. could you please tell me why? thanks. quote: originally posted by sergey slezkin if you want to get all raster images: code: oddbobjectid imagedictid = oddbrasterimagedef::imagedictionary( pdb ); if( !imagedictid.isnull() ) { oddbdictionaryptr pimagedict = imagedictid.safeopenobject( oddb::kforread ); oddbdictionaryiteratorptr piter = pimagedict->newiterator(); while (!piter->done()) { odstring strimagename = piter->name(); oddbrasterimagedefptr pimagedef = piter->getobject(); odstring strfilename = pimagedef->sourcefilename(); piter->step(); } } last edited by xidongzhang; 15th april 2005 at 08:49 amfff">. |
所有的时间均为北京时间。 现在的时间是 02:59 PM. |