几何尺寸与公差论坛------致力于产品几何量公差标准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-07, 02:57 PM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】rendering On Existing Mfc Device Conte

rendering on existing mfc device context

rendering on existing mfc device context
hi,
i say that i'm a newbie...
i need to render a dwg file in an mfc application on an mfv view.
the problem is that the application is existing and the dwg rendering engine is a plugin, than i cannot change view type subclassing it from a dwgdirect view class.
all i need is to know to which dwgdirect class have to pass my actual dc to render the file...
i hope to have been clear....
thank you in advance
walter

myzhar
# 3rd february 2006, 07:27 am

moderator join date: mar 2002
posts: 2,994
you can pass dc to wingdi device via its properties.
the device (and their properties) usage is illustrated in odamfcapp sample.
sergey slezkin

sslezkin
# 3rd february 2006, 07:59 am

registered user join date: feb 2006
location: pisa
posts: 69


ok, i read all the code of the example and of the device and i noticed that drawing is done using win32 commands (lineto, polygon, ecc).
the thing i want to know is if there is a way to render without using win32...

myzhar
# 3rd february 2006, 08:08 am

softdev join date: jun 2002
location: st'petersburg, russia
posts: 522

yes, there is a way to render without using win32.
see odvectorizeex sample.
sincerely yours,
george udov

george udov
# 3rd february 2006, 08:42 am

registered user join date: feb 2006
location: pisa
posts: 69


in example odvectorizeex (if i'm not wrong) a simple "string output device" is created, ok?
i noticed that al the drawing procedures are created like output streaming.
the example can be very useful to understand device creation
than the focus point of my question:
are there graphic rendering function in dwgdesign library?
excuse all these question, but i began working with library since 2 days and initial doubts are a lot
thank you again
walter

myzhar
# 6th february 2006, 03:54 am

softdev join date: jun 2002
location: st'petersburg, russia
posts: 522

could you, please, describe your problem with more details?
1. do you need to use dwgdirect rendering in mfc application, or in non-win32 application? note, that mfc is just a wrapper around win32 api.
2. "i cannot change view type subclassing it from a dwgdirect view class" - i cannot understand this. odamfcapp sample is mfc application that uses dwgdirect rendering - it does it with success. what is your problem?
sincerely yours,
george udov

george udov
# 6th february 2006, 04:19 am

registered user join date: feb 2006
location: pisa
posts: 69

sorry for my english
1) my application is mfc, but i would understand if dwglibrary has is own drawing routine such to use them on an existing image.
2) my problem is that i cannot create a new mfc view derivating it from dwgdirect class because i'm creating a plug in and rendering view just exists.
at the end all i need is a way to render on an existing image using existing dwgdirect routines...
i hope my explaination is better...
thank you
walter

myzhar
# 6th february 2006, 04:23 am

softdev join date: jun 2002
location: st'petersburg, russia
posts: 522

then question is - what is "existing image"?
do you have existing hdc?
sincerely yours,
george udov

george udov
# 6th february 2006, 04:57 am

registered user join date: feb 2006
location: pisa
posts: 69

i can write directly on existing hdc or on a bitmap that is then copied on hdc.
there is no difference. the problem is only understand which method is better.

myzhar
# 6th february 2006, 05:05 am

softdev join date: jun 2002
location: st'petersburg, russia
posts: 522

then you should create wingdi odgsdevice object, call setuplayoutviews, propagate your hdc to this odgsdevice, and then call odgsdevice::update().
if clearing your image by odgsdevice::update() before rendering dwg is not an issue for you, then you can use winopengl renderer.
if you does have hwnd for rendering window, then you also can use windirectx renderer.
sincerely yours,
george udov

george udov
# 6th february 2006, 05:14 am

registered user join date: feb 2006
location: pisa
posts: 69

ok, then if i have an existing background image the better method is to use wiggdi odgsdevice object and propagate my hdc.
do you think that looking for wingdi code added to odamfcapp would be a good method to learn how to do this?
which are the basic steps?
thank you a lot again
walter

myzhar
# 6th february 2006, 06:18 am

softdev join date: jun 2002
location: st'petersburg, russia
posts: 522

method cdwgviewer::createdevice() (dwgviewer.cpp) solves same task. it creates odgsdevice, then propagates there existing hdc, then calls setupactivelayoutviews().
after this, you can call m_pdevice->update(). it will render the drawing onto existing hdc that you propagated.
sincerely yours,
george udov

george udov
# 6th february 2006, 06:41 am

registered user join date: feb 2006
location: pisa
posts: 69

quote:
originally posted by george udov
method cdwgviewer::createdevice() (dwgviewer.cpp) solves same task.
i'm trying to see how it works, but i cannot link odamfcapp... in every configuration i get an unresolved external on odrxmodule that i cannot resolve...
do you know which library file includes it?
myzhar
==============
ing. walter lucetti
geomind srl
pisa - italy
==============

myzhar
# 6th february 2006, 07:09 am

registered user join date: feb 2006
location: pisa
posts: 69

i resolved all unresolved external but this:
odamfcapp error lnk2001: unresolved external symbol "class odrxmodule * __cdecl odrxcreatemoduleobject_for_bitmapmodule(char const *)" (?odrxcreatemoduleobject_for_bitmapmodule@@yapavod rxmodule@@pbd@z)
i don't find the library related with that
myzhar
==============
ing. walter lucetti
geomind srl
pisa - italy
==============

myzhar
# 6th february 2006, 08:06 am

registered user join date: feb 2006
location: pisa
posts: 69

ok, i solved the problem...
i missed winbitmap lib.
now i hope to be able to use wingdi
thank you for all help
greetings,
myzhar
==============
ing. walter lucetti
geomind srl
pisa - italy
==============

myzhar
page 1 of 21

none
? | ?
thread tools



display modes
linear mode


search this thread

rate this thread
excellent
good
average
bad
terrible

posting rules
you may post new threads
you may post replies
you may post attachments
you may edit your posts
is on
are on
code is off
html code is off
forum jump
user control panel private messages subscriptions who's online search forums forums home general topics news questions and remarks business issues industry commentary general software issues documentation issues future directions dwg libraries dwgdirect.net dwgdirect, c++ version dwgdirectx, activex version adtdirect/c3ddirect opendwg toolkit/viewkit dgn libraries dgndirect, c++ version (2.x+) dgndirect libraries (legacy 0.99xx)
all times are gmt -7. the time now is 11:35 pmfff">.
- - -
copyright ?2000 - 2009, jelsoft enterprises ltd.
copyright 1998-2008 open design alliance inc.
you can pass dc to wingdi device via its properties.
the device (and their properties) usage is illustrated in odamfcapp sample.
sergey slezkin


ok, i read all the code of the example and of the device and i noticed that drawing is done using win32 commands (lineto, polygon, ecc).
the thing i want to know is if there is a way to render without using win32...

yes, there is a way to render without using win32.
see odvectorizeex sample.
sincerely yours,
george udov


in example odvectorizeex (if i'm not wrong) a simple "string output device" is created, ok?
i noticed that al the drawing procedures are created like output streaming.
the example can be very useful to understand device creation
than the focus point of my question:
are there graphic rendering function in dwgdesign library?
excuse all these question, but i began working with library since 2 days and initial doubts are a lot
thank you again
walter

could you, please, describe your problem with more details?
1. do you need to use dwgdirect rendering in mfc application, or in non-win32 application? note, that mfc is just a wrapper around win32 api.
2. "i cannot change view type subclassing it from a dwgdirect view class" - i cannot understand this. odamfcapp sample is mfc application that uses dwgdirect rendering - it does it with success. what is your problem?
sincerely yours,
george udov

sorry for my english
1) my application is mfc, but i would understand if dwglibrary has is own drawing routine such to use them on an existing image.
2) my problem is that i cannot create a new mfc view derivating it from dwgdirect class because i'm creating a plug in and rendering view just exists.
at the end all i need is a way to render on an existing image using existing dwgdirect routines...
i hope my explaination is better...
thank you
walter

then question is - what is "existing image"?
do you have existing hdc?
sincerely yours,
george udov

i can write directly on existing hdc or on a bitmap that is then copied on hdc.
there is no difference. the problem is only understand which method is better.

then you should create wingdi odgsdevice object, call setuplayoutviews, propagate your hdc to this odgsdevice, and then call odgsdevice::update().
if clearing your image by odgsdevice::update() before rendering dwg is not an issue for you, then you can use winopengl renderer.
if you does have hwnd for rendering window, then you also can use windirectx renderer.
sincerely yours,
george udov

ok, then if i have an existing background image the better method is to use wiggdi odgsdevice object and propagate my hdc.
do you think that looking for wingdi code added to odamfcapp would be a good method to learn how to do this?
which are the basic steps?
thank you a lot again
walter

method cdwgviewer::createdevice() (dwgviewer.cpp) solves same task. it creates odgsdevice, then propagates there existing hdc, then calls setupactivelayoutviews().
after this, you can call m_pdevice->update(). it will render the drawing onto existing hdc that you propagated.
sincerely yours,
george udov

quote:
originally posted by george udov
method cdwgviewer::createdevice() (dwgviewer.cpp) solves same task.
i'm trying to see how it works, but i cannot link odamfcapp... in every configuration i get an unresolved external on odrxmodule that i cannot resolve...
do you know which library file includes it?
myzhar
==============
ing. walter lucetti
geomind srl
pisa - italy
==============

i resolved all unresolved external but this:
odamfcapp error lnk2001: unresolved external symbol "class odrxmodule * __cdecl odrxcreatemoduleobject_for_bitmapmodule(char const *)" (?odrxcreatemoduleobject_for_bitmapmodule@@yapavod rxmodule@@pbd@z)
i don't find the library related with that
myzhar
==============
ing. walter lucetti
geomind srl
pisa - italy
==============

ok, i solved the problem...
i missed winbitmap lib.
now i hope to be able to use wingdi
thank you for all help
greetings,
myzhar
==============
ing. walter lucetti
geomind srl
pisa - italy
==============
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)
 


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

高级搜索
显示模式

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

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

相似的主题
主题 主题发起者 论坛 回复 最后发表
【转帖】odgicontextfordbdatabase mfc cview yang686526 DirectDWG 0 2009-05-06 08:42 PM
【转帖】how to propagate an directx device to dd yang686526 DirectDWG 0 2009-05-06 03:02 PM
【转帖】objectarx&dummies习题(二)—— using a mfc dialog yang686526 ObjectARX(C++) 0 2009-04-16 10:34 AM
【转帖】dll学习(资料收集) huangyhg vc编程 0 2008-05-17 09:24 PM
深入探讨mfc消息泵 huangyhg vc编程 2 2007-10-29 04:14 PM


所有的时间均为北京时间。 现在的时间是 04:11 PM.


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