Re: Printing graphics question
- Posted by Derek Parnell <ddparnell at bigpond.com> Dec 17, 2004
- 478 views
don cole wrote: > > > }}} <eucode> > junk=getPrinter() > if startDoc( "My Print Job" ) then-- start up the document > end if > junk=startPage() > > drawEllipse(id,False, 10, 10, 100, 100) > > if endDoc() then > releasePrinter() > end if > </eurcode> > > The above code works fine if id is a window, > but prints nothing if it is Printer. > > Is there an easy of doing this or do I have to make bitmaps? Yes it is this easy. However I can see two things you might need to do. You need an EndPage() call, plus you need to scale it correctly. The size of a screen pixel is not the same as a printer pixel. For a 100x100 screen ellipse, you need to calculate the how big that is needed to be on your printer. Calculate FacX = (w32Func(xGetDeviceCaps(Printer, LOGPIXELSX) / w32Func(xGetDeviceCaps(Screen, LOGPIXELSX) ) Calculate FacY = (w32Func(xGetDeviceCaps(Printer, LOGPIXELSY) / w32Func(xGetDeviceCaps(Screen, LOGPIXELSY) ) To scale, multiply the screen X values by FacX and the Screen Y values by FacY to get the pixel sizes for your printer. Another factor to look out for, if you are using a color printer, is to make sure that the screen color will be still suitable for the page. -- Derek Parnell Melbourne, Australia