how to get and change an image name
how to get and change an image name
hi there,
i have a raster image in a file. and i want to change the 'image name' and 'saved path'. i already changed the saved path using oddbrasterimagedef::setsourcefilename(myimagefile) . however, i don't know how to change the image name.
does anyone have some sample code to get the change the image name?
thanks!
al
hi,
i may be wrong, but i don't think it's possible to change the name of a raster once it has been inserted in the image dictionary.
a workaround could be to copy the existing oddbrasterimagedef and insert it with another name in the image dictionary. then you have to delete the existing one, and change the rasterdef object id of all referenced raster images.
torsten
raster image name is not stored in rasterimagedef. it's a the name of entry in raster image dictionary.
code:
oddbrasterimagedefptr pimagedef;
// raster image def dictionary
oddbdictionaryptr pdic = pimagedef->ownerid().safeopenobject(oddb::kforwrite);
pdic->setname(pdic->nameat(pimagedef->objectid()), newname);
sergey slezkin
sergey,
that's what i am looking for. thank you for your help.
al
how to set pimagedef?? thanks
quote:
originally posted by sergey slezkin
raster image name is not stored in rasterimagedef. it's a the name of entry in raster image dictionary.
code:
oddbrasterimagedefptr pimagedef;
// raster image def dictionary
oddbdictionaryptr pdic = pimagedef->ownerid().safeopenobject(oddb::kforwrite);
pdic->setname(pdic->nameat(pimagedef->objectid()), newname);
which pimagedef?
given raster image entity use:
oddbrasterimage::imagedefid()
given image name from image dictionary:
oddbdictionary::getat(name)
pointer from id can be obtained using oddbobjectid

enobject()
sergey slezkin