' From:  "lenzpaul" <paul@l...> Wed Sep 4, 2002  2:42 pm
'This program creates 20 times a QBITMAP,
'matches it's size to 1/5 of the paper size,
'writes a number and a line on the bitmap,
'and prints the bitmap.

DIM pw AS INTEGER

SUB MakeImage (n AS INTEGER)
DIM Font AS QFONT
Font.Size = pw / 50
DIM Image AS QBITMAP
Image.Width = pw \ 5
Image.Height = Image.Width
Image.Font = Font
Image.TextOut 0, 0, str$(n), 0, &HFFFFFF
Image.Line 0, 0, Image.Height, Image.Width, 0
DIM S AS QRECT
S.Left = 0
S.Top = 0
S.Right = Image.Width
S.Bottom = Image.Height
DIM D AS QRECT
D.Left = (n mod 4) * (pw \ 4)
D.Top = (n \ 4) * (pw \ 4)
D.Right = D.Left + Image.Width
D.Bottom = D.Top + Image.Height
Printer.CopyRect D, Image, S
END SUB

Printer.BeginDoc
pw = Printer.PageWidth
for i = 0 to 19
MakeImage(i)
next
Printer.EndDoc