problem with rendering linetype scales / printing with new v
problem with rendering linetype scales / printing with new vectorizing classes
i updated my application to use the new dd rendering classes, and i noticed that some bugs where fixed (and another one introduced, like said in my last post...);
anyway, for me these new classes are really great and i would like to use them also for printing, but it seems they're intended only for rendering on screen (hwnd instead a dc); the main reason for that is that the old classes have a bug (that i haven't noticed until dd 1.10) when rendering linetypes different from continuous - the linetype scale changes with the zoom, and when printing the linetype scale is too small (it seems that the global linetype scale factor is ignored); the new classes work very well in this respect, all linetypes are represented correctly and with the right scale.
is this a known bug with the old rendering squeme or is there something that i can do to solve it? (ideally i would like to use the new classes for printing also...); this is really important since these drawings with incorrect line scales are generating problems with our suppliers...
thanks for your attention,
tiago gehring
hi,
with fix attached to new classes must print fine:
code:
void cdwgviewer:

nprint(cdc* pdc, cprintinfo* pinfo)
{
crect rcdraw = pinfo->m_rectdraw;
if(m_pprinterdevice.isnull())
{
m_pprinterdevice = theapp.getdevicebyflags(odgsdeviceinfo:

dgsdeviceflagprinter | odgsdeviceinfo:

dgsdeviceflaggdi);
m_pprinterdevice = oddbgsmanager::setupactivelayoutviews(m_pprinterdevice, this);
odgsdcrect rc(odgsdcpoint(rcdraw.left, rcdraw.bottom-1), odgsdcpoint(rcdraw.right-1, rcdraw.top));
m_pprinterdevice->onsize(rc);
m_pprinterdevice->setlogicalpalette(odcmacadlightpalette(), 256);
m_pprinterdevice->setbackgroundcolor(odrgb(255,255,255));
// copy view data
int n = m_pdevice->numviews();
for(int i=0; i<n; ++i)
{
const odgsview* pfrom = m_pdevice->viewat(i);
odgsview* pto = m_pprinterdevice->viewat(i);
if(pfrom && pto)
{
pto->setview(pfrom->position(), pfrom->target(), pfrom->upvector(),
0.0, pfrom->fieldheight(),
pfrom->isperspective() ? odgsview::kperspective : odgsview::kparallel);
}
}
}
m_pprinterdevice->properties()->putat("windowhdc", odrxvariantvalue((long)pdc->m_hdc));
setplotgeneration(true);
m_pprinterdevice->update(0);
setplotgeneration(false);
cview:

nprint(pdc, pinfo);
}
create exgsgdivectorizedevice instance for m_pprinterdevice.
dmitry,
thanks for your reply. i tested your suggestion and was able to print a file, but i still have problems with linetype scales (btw when trying to intantiate a odsmartptr<exgsgdivectorizedevice> object the compiler said that operator -> was ambiguous, so what i did was cast the odgsdevice * into a exgsgdivectorizedevice *);
i also looked at how class exscreendevice is implemented and created a exprinterdevice based on it, so i declare my device as
exprinterdevice<exgsgdivectorizedevice> ptrdevice; it also worked and i was able to print files, but again i have problems with line scales;
what is strange is that the drawing appears ok on screen, it's just when i print it that i have problems. i re-checked how i create the device for viewing and confirmed that it's declared as exscreendevice<exgsgdivectorizedevice>, so for me viewing/printing should use the same vectorizing squeme.
i really don't know what i'm doing wrong, any suggestion appreciated..
thanks again,
tiago