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

几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量 (http://www.dimcax.com/hust/index.php)
-   DirectDWG (http://www.dimcax.com/hust/forumdisplay.php?f=89)
-   -   【转帖】painting on top of dwgdirec (http://www.dimcax.com/hust/showthread.php?t=17834)

yang686526 2009-05-06 09:36 PM

【转帖】painting on top of dwgdirec
 
painting on top of dwgdirect
painting on top of dwgdirect
in our application we need to draw on top of the dwgdirect drawing. i've tried numerous things to accomplish this but it appears that the core problem we are faced with is update on odgsdevice is an asynchronous operation. so we call update, then draw our graphics and then sometime after that the drawing is refreshed and draws over what we drew.
any suggestion on how we can draw on top of dwgdirect?
quote:
originally posted by markr
it appears that the core problem we are faced with is update on odgsdevice is an asynchronous operation.
it's not. actualy, it's synchronous. in odamfcapp there was an attempt to call it in a separate thread, but we faced a lot of problem synchronizing access to database. so since release 2.0 odgsdevice::update() is called from main thread.
quote:
originally posted by markr
so we call update, then draw our graphics and then sometime after that the drawing is refreshed and draws over what we drew.
any suggestion on how we can draw on top of dwgdirect?
just draw after each call to odgsdevice::update().
thanks for the reply.
i got it working but i did find something a bit strange.
if the paint routine supplies an hdc (e.g. cpaintdc or graphics in .net), then anything drawn by the app will be overdrawn by drawing. if you explicitly create an hdc or graphics, it works fine.
its working, so i'm happy just thought i'd pass on the extra information.


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