查看单个帖子
旧 2009-05-07, 12:21 PM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】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">.
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)