display drawing without background
display drawing without background
we are implementing dwgdirect in a c++ mfc application, where the drawing will be displayed among other components. displaying the drawing works fine, and also all other components drawn after the import of the drawing shows, but anything done prior to the dwg import is hidden by the drawing's background.
how to avoid drawing any background or how to make the background transparent?
m j
# 25th january 2005, 07:32 am
moderator join date: dec 1969
posts: 811
there is no way to control this in our 1.12 version, but we will provide a mechanism for controlling this in our upcoming 1.13 release.
npeterson
# 6th april 2005, 07:40 pm
registered user join date: mar 2005
posts: 5
i am having a similar problem. i orginally created a dwg to wmf conversion program using the opendwg toolkit\viewkit, which did not seem to output the background of paperspace drawings.
now i am trying to recreated the exact same wmf image using the dgwdirect c++ library, and now the background of paperspace drawings are forcing the wmf image to be slightly larger than expected. if there was some way to prevent the background from being drawn, i could prevent this.
when will dwgdirect 1.13 be available, with the ability to surpress the background?
regards,
sijmen.
sijmeng
# 7th april 2005, 08:40 am
moderator join date: dec 1969
posts: 811
we are polishing it right now, and if all goes well it should be available early next week.
npeterson
# 22nd april 2005, 03:04 am
registered user join date: oct 2002
posts: 16
how can i avoid the background being cleared in the newly released version 1.13?
stefan hestner
# 22nd april 2005, 04:04 am
moderator join date: mar 2002
posts: 2,994
see "control of background paper display during vectorization" in release notes.
sergey slezkin
sslezkin
# 25th april 2005, 01:52 am
registered user join date: oct 2002
posts: 16
i have looked at the oddblayoutpaperpe class but i dont think that it can solve my problem. what i wonder is if it's possible to prevent the window background from being cleared when i call odgsdevice->update(). i would like to draw several dwg-files in the same window but for each call to update the background is erased. (same problem as described by the signature m j originally).
stefan hestner
# 25th april 2005, 07:29 pm
registered user join date: may 2003
location: brisbane, australia
posts: 39
its important to note that the background is not cleared. when the drawing is rendered, it draws a solid polygon over any previously rendered drawing, which represents the background. you simply need to prevent the background from being rendered.
add the following code somewhere in a header file:
code:
#include "odacommon.h"
#include "staticrxobject.h "
#include "dblayoutpaperpe.h"
class cdwglayoutpapercustomizationpe : public odstaticrxobject<oddblayoutpaperpe>
{
public:
virtual bool drawpaper(const oddblayout* , odgiworlddraw* pwd, odgepoint3d* points) { return true; }
virtual bool drawborder(const oddblayout* , odgiworlddraw* pwd, odgepoint3d* points) { return true; }
virtual bool drawmargins(const oddblayout* , odgiworlddraw* pwd, odgepoint3d* points) { return true; }
};
then in your code after calling odinitialize(...) and odgsinitialize(), add the following code:
code:
// add the extension to disable the drawing border from being rendered.
cdwglayoutpapercustomizationpe paperdrawingpe;
oddblayout::desc()->addx(oddblayoutpaperpe::desc(), &paperdrawingpe);
and finally, just before calling odgsuninitialize() and oduninitialize(), add the following code:
code:
// remove the extension to disable the drawing border from being rendered.
oddblayout::desc()->delx(oddblayoutpaperpe::desc());
this will prevent any of the border and background from being rendered.
regards,
sijmen.
sijmen.grunbauer@mincom.com
# 26th april 2005, 03:30 am
registered user join date: oct 2002
posts: 16
thanks for your help sijmen. but i still don't get it right. i have implemented the three draw-methods, and have them to do nothing but return true. and i have checked in the debugger that they are called. the solid polygon is still drawn, making everything hidden.
i have also tried to set the clearscreen flag to false but the only effect it has is that the polygon changes color to black:
odgsdeviceptr->odrxdictionaryptr->putat("clearscreen", odrxvariantvalue(false));
another problem is that i need this to work in model space layouts as well.
wbr,
stefan
stefan hestner
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 12:19 amfff">.
- - -
copyright ?2000 - 2009, jelsoft enterprises ltd.
copyright 1998-2008 open design alliance inc.
there is no way to control this in our 1.12 version, but we will provide a mechanism for controlling this in our upcoming 1.13 release.
i am having a similar problem. i orginally created a dwg to wmf conversion program using the opendwg toolkit\viewkit, which did not seem to output the background of paperspace drawings.
now i am trying to recreated the exact same wmf image using the dgwdirect c++ library, and now the background of paperspace drawings are forcing the wmf image to be slightly larger than expected. if there was some way to prevent the background from being drawn, i could prevent this.
when will dwgdirect 1.13 be available, with the ability to surpress the background?
regards,
sijmen.
we are polishing it right now, and if all goes well it should be available early next week.
how can i avoid the background being cleared in the newly released version 1.13?
see "control of background paper display during vectorization" in release notes.
sergey slezkin
i have looked at the oddblayoutpaperpe class but i dont think that it can solve my problem. what i wonder is if it's possible to prevent the window background from being cleared when i call odgsdevice->update(). i would like to draw several dwg-files in the same window but for each call to update the background is erased. (same problem as described by the signature m j originally).
its important to note that the background is not cleared. when the drawing is rendered, it draws a solid polygon over any previously rendered drawing, which represents the background. you simply need to prevent the background from being rendered.
add the following code somewhere in a header file:
code:
#include "odacommon.h"
#include "staticrxobject.h "
#include "dblayoutpaperpe.h"
class cdwglayoutpapercustomizationpe : public odstaticrxobject<oddblayoutpaperpe>
{
public:
virtual bool drawpaper(const oddblayout* , odgiworlddraw* pwd, odgepoint3d* points) { return true; }
virtual bool drawborder(const oddblayout* , odgiworlddraw* pwd, odgepoint3d* points) { return true; }
virtual bool drawmargins(const oddblayout* , odgiworlddraw* pwd, odgepoint3d* points) { return true; }
};
then in your code after calling odinitialize(...) and odgsinitialize(), add the following code:
code:
// add the extension to disable the drawing border from being rendered.
cdwglayoutpapercustomizationpe paperdrawingpe;
oddblayout::desc()->addx(oddblayoutpaperpe::desc(), &paperdrawingpe);
and finally, just before calling odgsuninitialize() and oduninitialize(), add the following code:
code:
// remove the extension to disable the drawing border from being rendered.
oddblayout::desc()->delx(oddblayoutpaperpe::desc());
this will prevent any of the border and background from being rendered.
regards,
sijmen.
thanks for your help sijmen. but i still don't get it right. i have implemented the three draw-methods, and have them to do nothing but return true. and i have checked in the debugger that they are called. the solid polygon is still drawn, making everything hidden.
i have also tried to set the clearscreen flag to false but the only effect it has is that the polygon changes color to black:
odgsdeviceptr->odrxdictionaryptr->putat("clearscreen", odrxvariantvalue(false));
another problem is that i need this to work in model space layouts as well.
wbr,
stefan