![]() |
【转帖】how to render custom raster
how to render custom raster
how to render custom raster i am in the process of porting some old odv code to the new directx libraries but can't figure out how to render raster images properly. what i am looking for is some advice on how to get the same functionality that the old odv rawimagepreparefn, rawimagefn and rawimagereleasefn used to do. i have successfully managed to load the raster reference with the exsystemservices::loadrasterimage callback. but i can't get the raster rendered because my cmydevice::rasterimageproc() never gets called during the rendering process. any help would be highly appreciated... thanks, lars tungen norway quote: cmydevice::rasterimageproc() never gets called during the rendering process. strange. what is base class for cmydevice? btw, in 1.11 there are no function loadrasterimage in system services. dynamic modules are used for loading of raster images (see rxrasterservices.h header). sincerely yours, george udov quote: originally posted by george udov strange. what is base class for cmydevice? btw, in 1.11 there are no function loadrasterimage in system services. dynamic modules are used for loading of raster images (see rxrasterservices.h header). tha base classes for cmydevice are: class cmydevice: public odgsbasevectorizedevice, public odgigeometrysimplifier { i followed the instructions outlined in "creating a rendering application" in the help file. please set breakpoint to exgssimpledevice::rasterimageproc function (odvectorizeex sample). then try to run vectorizeex for some file containing raster image entity. if you stop on this breakpoint, you'll have an example of vectorizing device which rasterimageproc() method gets called during the rendering process. if you don't stop, then something is wrong, needs to be looked into. sincerely yours, george udov viewing embeded jpeg images quote: originally posted by george udov please set breakpoint to exgssimpledevice::rasterimageproc function (odvectorizeex sample). then try to run vectorizeex for some file containing raster image entity. if you stop on this breakpoint, you'll have an example of vectorizing device which rasterimageproc() method gets called during the rendering process. if you don't stop, then something is wrong, needs to be looked into. george, i built the odvectorizeex project and i placed a breakpoint at the line setcurrtraits(); of rasterimageproc while processing a drawing file with embedded jpg images. the code never gets executed! i am trying to write code to be able to view embedded raster images. unfortunately, the odamfcapp does not view them either. odamfcapp only draws the border around the images whether i am using wingdi or opengl as the vectorizer. changing background color does not help either. sincerely yours, robert what is "embedded raster images"? in drawing tree control of odamfcapp do you see acdbrasterimage or acdbole2frame entities? sincerely yours, george udov quote: originally posted by george udov what is "embedded raster images"? in drawing tree control of odamfcapp do you see acdbrasterimage or acdbole2frame entities? dear george, by embedded images, i meant images inserted into the paper space layout using the autocad insert raster image command. i examined the tree control of odamfcapp and the definitions of the inserted images are shown. i have attached a small bmp file showing the list. under the acad_image_tree, there are 4 entries for acdbrasterimagedef corresponding to the 4 jpg images i have inserted into the test drawing. i can view this test drawing successfully with the old libraries. thanks robert attached images (6.4 kb, 14 views) quote: originally posted by george udov what is "embedded raster images"? in drawing tree control of odamfcapp do you see acdbrasterimage or acdbole2frame entities? dear george, some additional information. the odamfcapp tree control also shows references to the raster images under the acdbblock table. i forgot to mention this in my previous reply. i am attaching a small bmp file showing these references. robert attached images (11.9 kb, 16 views) dear robert, thank you for additional info. in this case (autocad insert/raster image command) raster images aren't embedded into dwg/dxf file. dwg/dxf file stores link to file with image. what is interesting: 1) which version of dd do you use? lib or dll? 2) does function exrastermodule::loadrasterimage (located in file examples\exservices\exgirasterimage.cpp) ever gets executed? sincerely yours, george udov raster image problem quote: originally posted by george udov dear robert, thank you for additional info. in this case (autocad insert/raster image command) raster images aren't embedded into dwg/dxf file. dwg/dxf file stores link to file with image. what is interesting: 1) which version of dd do you use? lib or dll? 2) does function exrastermodule::loadrasterimage (located in file examples\exservices\exgirasterimage.cpp) ever gets executed? george, i use the dd_vc6md libraries. i did notice that in odamfcapp, the only reference to loadrasterimage is in this statement in debugcommand.h: odgirasterimageptr rast = odsystemservices()->loadrasterimage(imagename); it will never be executed however because the statement is in the function: void extern_debugcommand(codamfcappdoc* pdoc, cdwgview* ) but the function is inside a #if 0-#endif preprocessor directive. i will see what happens if i activate this code. thanks last edited by robertpantangco@hotmail.com; 31st august 2004 at 10:49 amfff">. which version of dd do you use? does your version have file examples\exservices\exgirasterimage.cpp ? does odamfcapp.cpp of your dwgdirect version contain strings odrx_declare_static_module_entry_point(exrastermod ule); and odrx_define_static_application("rxrasterservices", exrastermodule) ? sincerely yours, george udov raster image problem dear george, i am using v1.11.01 with file dates in june 2004. yes, my dd version has examples\exservices\exgirasterimage.cpp with a file date of june 29, 2004. yes, both odrx_declare_static_module_entry_point(exrastermod ule); and odrx_define_static_application("rxrasterservices", exrastermodule) are in the odamfcapp.cpp. george, i think the only problem here is that odamfcapp should be fixed to activate loading of the raster images during vectorization. it seems like all the hooks are already in place. but i will study exgirasterimage.cpp to see if i can implement the changes myself. thanks dear robert, please assure that your application (as i understand, it uses lib version of dwgdirect) has macros that i mentioned in my previous post somewhere in code. then please assure that exrastermodule::loadrasterimage ever gets executed during vectorization process. sincerely yours, george udov |
所有的时间均为北京时间。 现在的时间是 06:38 PM. |