![]() |
【转帖】how to find the associated filepath for images during vector
how to find the associated filepath for images during vector
how to find the associated filepath for images during vectorization? hi, in vectorization framework, inside rasterimageproc() is there a way to get the path of the image file from which the raster image was constructed? the odgirasterimage argument passed to the method doesn't seem to expose any such information. thanks no, there is no such way. in common case, rasterimageproc() may be called for image, that was constructed not from file. for example, ole rendering in opengl and directx gs devices. or shaded viewports rendering in dwf export. sincerely yours, george udov quote: originally posted by varunsnair hi, in vectorization framework, inside rasterimageproc() is there a way to get the path of the image file from which the raster image was constructed? the odgirasterimage argument passed to the method doesn't seem to expose any such information. thanks in our derived odgsbasevectorizeview class we implement: virtual void draw( const odgidrawable* drawable ); in this method, we watch for oddbrasterimages to come through: if ( pobject->isa() == oddbrasterimage::desc() ) { // rasters need special processing device()->m_rasterimage = oddbrasterimage::cast( pobject.get() ); } when they come through we store the raster image object being drawn. later, when rasterimageproc is called we use the stored pointer to get the file path: oddbobjectptr ptr = m_rasterimage->imagedefid().safeopenobject(); oddbrasterimagedef* imagedef = oddbrasterimagedef::cast( ptr.get() ); imagefilename = imagedef->sourcefilename().c_str(); hope that helps, chad i agree, but it is important to remember, that not each rasterimageproc have corresponding oddbrasterimagedef. sincerely yours, george udov thanks for your replies guys. we are now implementing our own raster services module and are storing the filepath in the implementation of odgirasterimage during its creation in loadrasterimage(). this allows us to not only handle a larger number of raster formats but also supports better type and error checking for the raster files. |
所有的时间均为北京时间。 现在的时间是 08:55 AM. |