Method | Type | Description | Params |
Abort | SUB | Abort printing the document | 0 |
BeginDoc | SUB | Starts new document to print | 0 |
| BeginDoc sends a print job to the printer.
|
EndDoc | SUB | Nothing is printed until this is called | 0 |
| EndDoc will start the print job.
|
NewPage | SUB | Start printing on a new page | 0 |
Circle | SUB (x1%, y1%, x2%, y2%, c%, fill%) | Draw & Fill Circle | 6 |
CopyRect | SUB (D, Image, S) | D and S are QRECTs, Image can be a QImage, QCanvas, or QBitmap | 3 |
Draw | SUB (x%, y%, BMP) | Draw Bitmap on Canvas | 3 |
FillRect | SUB (x1%, y1%, x2%, y2%, c%) | Draws & Fills a rectangle | 5 |
Line | SUB (x1%, y1%, x2%, y2%, c%) | Draws a line | 5 |
Paint | SUB (x%, y%, c%, borderc%) | Fill Region | 4 |
Pset | SUB (x%, y%, c%) | Pixel plot | 3 |
Rectangle | SUB (x1%, y1%, x2%, y2%, c%) | Draws a rectangle | 5 |
RoundRect | SUB (x1%, y1%, x2%, y2%, x3%, y3%, c%) | Draws & Fills a rounded rectangle | 7 |
StretchDraw | SUB (Rect AS QRECT, BMP) | Draw BMP and stretch to fit inside Rect | 2 |
TextHeight | FUNCTION (Text$) AS WORD | Returns the height, in pixels, of Text$ string | 1 |
TextWidth | FUNCTION (Text$) AS WORD | Returns the width, in pixels, of Text$ string | 1 |
TextRect | SUB (Rect AS QRECT, x%, y%, S$, fc%, bc%) | Write text, and clip within region Rect | 6 |
TextOut | SUB (x%, y%, S$, fc%, bc%) | Writes text to printer | 5 |
Printer Examples
DECLARE SUB ButtonClick
SUB ComboBoxChange(Sender AS QComboBox)
Printer.PrinterIndex = Sender.ItemIndex '-- Change default printer
END SUB
DIM Font AS QFont
Font.Color = &HFF0000
Font.Name = "Arial"
Font.Size = 20
DIM Bitmap AS QBitmap
Bitmap.BMP = "rapidq.bmp"
CREATE Form AS QForm
CREATE ComboBox AS QComboBox
Left = 5
Top = 5
Width = 150
OnChange = ComboBoxChange
END CREATE
CREATE Button AS QButton
Caption = "&Print"
Top = 3
Left = 180
OnClick = ButtonClick
END CREATE
CREATE GroupBox AS QGroupBox
Caption = "Print Preview..."
Top = 35
Width = Form.ClientWidth
END CREATE
Center
END CREATE
FOR I = 0 TO Printer.PrintersCount-1
ComboBox.AddItems(Printer.Printers(I)) '-- Add printer list to combobox
NEXT
ComboBox.ItemIndex = Printer.PrinterIndex
Form.ShowModal
SUB ButtonClick
Printer.Orientation = 1 ' Landscape
Printer.BeginDoc
Printer.TextOut(1000,1000,"Hi World!",0,-1)
Printer.Font = Font
Printer.TextOut(10,10,"Does this print?",0,-1)
Printer.Line(10,10,500,500,0)
Printer.EndDoc
END SUB