几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量  


返回   几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量 » 仿射空间:CAX软件开发(三)二次开发与程序设计 » CAD二次开发 » AutoCAD二次开发 » DirectDWG
用户名
密码
注册 帮助 会员 日历 银行 搜索 今日新帖 标记论坛为已读


回复
 
主题工具 搜索本主题 显示模式
旧 2009-05-06, 03:08 PM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】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
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)
回复


主题工具 搜索本主题
搜索本主题:

高级搜索
显示模式

发帖规则
不可以发表新主题
不可以回复主题
不可以上传附件
不可以编辑您的帖子

vB 代码开启
[IMG]代码开启
HTML代码关闭

相似的主题
主题 主题发起者 论坛 回复 最后发表
【转帖】custom objects yang686526 DirectDWG 0 2009-05-04 06:56 PM
【转帖】adding custom objects to a custom dictionary yang686526 DirectDWG 0 2009-05-04 03:43 PM
【转帖】objectarx&dummies教程(十三)—— deriving from acdbentity yang686526 ObjectARX(C++) 0 2009-04-16 10:40 AM
【转帖】custom properties yang686526 SolidWorks二次开发 0 2009-04-13 10:09 AM
【转帖】custom properties for multiple part configurations yang686526 SolidWorks二次开发 0 2009-04-13 10:08 AM


所有的时间均为北京时间。 现在的时间是 08:36 AM.


于2004年创办,几何尺寸与公差论坛"致力于产品几何量公差标准GD&T | GPS研究/CAD设计/CAM加工/CMM测量"。免责声明:论坛严禁发布色情反动言论及有关违反国家法律法规内容!情节严重者提供其IP,并配合相关部门进行严厉查处,若內容有涉及侵权,请立即联系我们QQ:44671734。注:此论坛须管理员验证方可发帖。
沪ICP备06057009号-2
更多