Hi, Barrie,
Set up a global 'graphics scale Factor' property:
gSF As Double
and a setter method:
Sub setDwngScaleFactor (scrnRes As Integer, deviceRes As Integer)
gSF = deviceRes/scrnRes
End Sub
So, for a 600 dpi printer, your scale factor would be 8.333...
gSF = 600/72
and if your output device is the screen, your scale factor will be 1.0...
gSF = 72/72
Whenever you establish a pixel position or a dimension, multiply it by gSF:
x1 = xBorder * gSF
y1 = yBorder * gSF
myRect.Width = 100 * gSF
myrect.Height = 200 * gSF
pen.Width = .25 * gSF // gives a 1/4 width line on an output device with
enough resolution
Before you send something to the printer, reset gSF in accordance with the
resolution of the device. Probably, you will see some interesting and
unexpected results before you get the hang of it.
P.
***********************************************
on 11/29/04 7:13 PM, Barrie Jones at barrie at spamcop dot net wrote:
> Sorry Joe, I am getting confused. In my previous programming
> environment, (Future Basic) I could print hairlines on my 300 dpi laser
> printer and 1200 dpi ink jet printer with no special attention to
> physical printer configurations. In RB, the finest line that I can
> print is defined as g.penWidth = 1 and g.penHeight = 1. This results
> in a line width of 1/72 inch on both the above printers. I think I need
> to send a software instruction to the printer so that it will know that
> g.penHeight sets printer pixels and not screen pixels. Is this correct?
> If so where can I find the appropriate code?
> Thanks
> Barrie
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://www.realsoftware.com/listarchives/lists.html>
|