odgiconveyorgeometry::rasterimageproc() not being called?
odgiconveyorgeometry::rasterimageproc() not being called?
i compiled odvectorizeex.dsp
the program argument is a drawing containing images from a jpg and bmp.
i debugged throught the code and it does not appear to be calling this function:
void exgssimpledevice::rasterimageproc(const odgepoint3d& origin ...
any idea?
thanks,
codey
such effect may occur because file with raster image was not found.
you can override oddbhostappservices::findfile() and look if it was found.
sincerely yours,
george udov
i did that, overriden findfile() and debugged throught it to see the paths. i tested with fullpath and no path, and made sure the files exist in current directory and the fullpath locations. i tried another application using od2dexportview::rasterimageproc() and it is also not working.
i've attached the dwg, image files, and output txt file. the output txt file should contain "rasterimageproc", but it does not.
i'm using msvc6 and dd 1.3.02
thanks,
codey
attached files (351.3 kb, 18 views)
codey,
do you use lib or dll configuration of dd?
if you use lib, did you declared this (in your static module map section, see example at odamfcapp.cpp):
odrx_declare_static_module_entry_point(exrastermod ule);
odrx_begin_static_module_map()
odrx_define_static_application("rxrasterservices", exrastermodule)
odrx_end_static_module_map()
if you use dll, did you built rxrasterservices.drx?
sincerely yours,
george udov
yep, that works. thanks george.
(1) i added the raster part in odvectorizeex.cpp
// define module map for statically linked modules:
#if !defined(_toolkit_in_dll_) || defined(__mwerks__)
odrx_declare_static_module_entry_point(modelermodu le);
odrx_declare_static_module_entry_point(exrastermod ule);
odrx_begin_static_module_map()
odrx_define_static_application("modelergeometry", modelermodule)
odrx_define_static_application("rxrasterservices", exrastermodule)
odrx_end_static_module_map()
#endif
(2) added dd_vc6md_rxrasterservices.lib in link build settings.
hi,
i was struck in a similar problem and this thread helped me a lot.
one thing i noticed that when i try to run the attached files thru my app, the rasterimageproc() call only comes for the bmp file and not the jpeg file, although both are found in findfile() (same behavior in odvectorizeex). do we need to do something extra for jpeg files and also what other raster file formats are supported? i am using the libs of dd.
thanks
quote:
one thing i noticed that when i try to run the attached files thru my app, the rasterimageproc() call only comes for the bmp file and not the jpeg file, although both are found in findfile() (same behavior in odvectorizeex). do we need to do something extra for jpeg files and also what other raster file formats are supported?
yes, you need to implement your own rxrasterservices module.
exrastermodule (exrasterdll project) is a sample of such module, that support only bmp and jpeg(if compiled appropriately) formats.
sincerely yours,
george udov
so would i be able to work with both bmp and jpeg files if i just build the exraster project with raster_jpeg6b and in my app, link with the generated rxrasterservices.lib?
and if so, does the libs shipped in the release have the jpeg support removed on purpose?
quote:
so would i be able to work with both bmp and jpeg files if i just build the exraster project with raster_jpeg6b and in my app, link with the generated rxrasterservices.lib?
yes. you will also need to link with jpeg-6b library in this case (shipped with dd).
quote:
and if so, does the libs shipped in the release have the jpeg support removed on purpose?
single purpose - to reduce libraries size :-)
sincerely yours,
george udov
thanks.
although i would not have minded the extra size one bit, as i have to do this work now for vc, codewarrior and xcode.
are the projects for codewarrior and xcode for the samples availible for download?
hi george,
we seem to have run into trouble on mac.
we implemented everything in order and its working beautifully on windows. but on mac the rasterimageproc() is not called. the reason being that the image file is not found.
by overriding the findfile() method, we observed that while on windows the search for the file suceeded even when the image file is in the same folder as the file being opened (and not necessarily in the path specified while saving the drawing), on mac it did not even suceed when the file was exactly in the original path specified (say "/volumes/test/jpeg.jpg").
to me it looks like a problem in the implementation of oddbhostappservices::findfile(). could you please help.
we're using codewarrior libs version 1.14.01.
thanks
are you using cw8 or cw9? i tried a simple sample in cw9 giving it the full path of a file, and findfile() seemed to work ok. can you reproduce the problem in a simple sample, by just calling findfile() directly with a hardcoded path?
can reproduce problem on mac with hardcoded path
we're using cw9.
i could get the problem to reproduce with a hardcoded path with:
code:
odstring exhostappservices::findfile(const char* file,
oddbdatabase* pdb, oddbhostappservices::findfilehint hint)
{
char path[] = "/users/user/desktop/ui_1.jpg";
odstring teststr = oddbhostappservices::findfile(path, pdb, hint);
if (teststr.isempty())
{
// throw error alert
}
else
{
// show success alert
}
}
"/users/user/desktop/ui_1.jpg" did exist and could be accessed thru our app.
george shared with me the code for the implementation of findfile() inside oddbhostappservices. and i could get it to work on mac with this hack:
code:
odstring exhostappservices::findfile(const char* file,
oddbdatabase* pdb, oddbhostappservices::findfilehint hint)
{
odstring filepath = oddbhostappservices::findfile(file, pdb, hint);
if (filepath.isempty())
{
odchar platdelim = // get platform delimiter from our application
odchar olddelim = (platdelim == '/' ? '\\' : '/');
filepath = oddbhostappservicesfindfileimpl(file, pdb, hint,
olddelim, platdelim, '/');
}
return filepath;
}
where oddbhostappservicesfindfileimpl() is your implementation of the function, with just the signature modified to accept as additional parameter the referenced values which must have defined somewhere else in your code:
code:
odstring exhostappservices:

ddbhostappservicesfindfileimpl(
const char* file,
oddbdatabase* pdb,
oddbhostappservices::findfilehint hint,
odchar oldpathchar,
odchar pathchar,
char separatorchar);
looks to me that the problem might lie in the assigment of odpathchar and/or pathchar.
hope this helps in your investigation. please update me with your findings.
thanks
we were setting the incorrect path characters for our codewarrior builds, as you pointed out. the problem will be corrected in our next maintenance update.
thanks neil.
could you also please verify that it runs properly on xcode. since our app has not yet switched to xcode hence i can't check this on my end, but we'll be doing so a couple of months down the line and i don't want to be bugging you for the same thing with xcode.
btw, when is the next maintainance release of dd planned?