Re: Printing graphics question
- Posted by Derek Parnell <ddparnell at bigpond.com> Dec 18, 2004
- 437 views
don cole wrote: > I think you meant: Yes, my syntax was wrong. I was coding from the hip Now I've got some time to actually run it before posting, here is what I really meant ...
atom pdc atom sdc pdc = getDC(Printer) sdc = getDC(Screen) FacX = w32Func( xGetDeviceCaps, {pdc, LOGPIXELSX})/ w32Func(xGetDeviceCaps,{sdc, LOGPIXELSX} ) FacY = w32Func(xGetDeviceCaps,{pdc, LOGPIXELSY}) / w32Func(xGetDeviceCaps,{sdc, LOGPIXELSY} ) releaseDC(Screen) releaseDC(Printer)
This code above is to be run *after* you have chosen the printer.
You scale you video pixels thus ...
PrinterX = floor(VideoX * FacX) PrinterY = floor(VideoY * FacY)
The missing EndPage() was the problem.
Oh good. I really should do that automatically when the endDoc() is called.
I would still like to get formula down.
Shouldn't it be CWindow_Print_Preview not Screen?
Shouldn't it be CWindow_Print_Preview not Screen?
It doesn't matter. Both get the device capabilities of the *video* card being used.
Derek Parnell Melbourne, Australia }}}