查看单个帖子
旧 2009-05-06, 09:36 PM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】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.
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)