To use these functions you must add DPIncludes.dba to your project.

wp236dcb2a.png
wp33b329ba.png
wp135453fd.png
wp0db7c5a9.png
rem *** PRINTER SCALER TESTER TESTER ***
rem *** Written By Jack Taylor 2008 ***
PC As integer
cx as integer
cy as integer
pc as integer
prompt as string
ptr as dword
width as dword
height as dword
unit_width as float
unit_height as float
minor_divisions_x as float
minor_divisions_y as float
mdn as integer
half_of_inch as float
quater_of_inch as float
half_of_inch as float
units as Integer
fontsize as float
mess as string
x as float
y as float
count as integer
DarkInk
print
print "*** PRESS ANY KEY TO CONTINUE ***"
wait key

cls
PC = GET PRINTER COUNT()
if PC < 1
PRINT "THERE ARE NO PRINTERS INSTALLED ON YOUR SYSTEM YOU MUST HAVE AT LEAST 1 PRINTER"
wait key
end
endif
fOR I = 1 TO PC
PRINT I," ", Get_Printer_Name(I - 1)
next i
BADPRINTER:
prompt = "Please select a printer between 1 and " +Str$(PC) + " ? "
input prompt,i
if i < 0 or i > pc then goto BADPRINTER
if I > 0 then SET PRINTER INDEX I - 1
rem *** Draw Grided rulers round the edge of the printed page ***
cls
PRINT "PRESS 1 TO PRINT RULERS IN INCHES"
PRINT "PRESS 2 TO PRINT RULERS IN CENTIMETERS"
BADSELECTION:
Input "?",I
wpe88430a1.png
If I < 1 or I > 2 then goto BADSELECTION
if I = 1
units = UNITS_INCHES
mdn = 8
fontsize = 8
mess = "inches"
else
units = UNITS_CM
mdn = 10
fontsize = 8
mess = "centimetres"
endif
Rem *** Set UP PRINTER FONT ***
SET PTEXT FONT "Arial"
SET PTEXT SIZE fontsize
SET PTEXT TRANSPARENT
width = GET PRINTER PAGE WIDTH()
height = GET PRINTER PAGE HEIGHT()
unit_width = PRINTED LENGTH X(width, units)
print "width in " + mess + " ",unit_width
unit_height = PRINTED LENGTH Y(height, units)
print "height in " + mess + " ",unit_height
rem *** DRAW VERTICAL RULER IN Y Direction ***
y#=0
ix# = PRINTER PIXELS IN LENGTH X(1,UNITS_INCHES)
print "pixels in 1 inch x = ",ix#
hix = ix# / 2
qix = ix# / 4
iy# = PRINTER PIXELS IN LENGTH Y(1,UNITS_INCHES)
print "pixels in 1 inch y = ",iy#
hiy = iy# / 2
qiy = iy# / 4
count = 0
dc =0
print "ruler units " + mess
s# = PRINTER PIXELS IN LENGTH Y(1,units) / mdn
print "step size = ", s#
lp_ix# = ix# * 0.6
wait key
repeat
if (count mod mdn) = 0
PLOT LINE 0,y#,hix,y#
A$ = STR$(dc)
hth# = GET PTEXT HEIGHT(A$) / 2.0
LTEXT lp_ix#, y# - hth#, A$
inc dc,1
else
plot line 0,y#,qix,y#
endif
inc count,1
y# = y# + s#
until y# >= height
wped374b78.png