Метод | Тип | Описание | Параметры |
|
|
|
|
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%) | Рисует и заливает окружность | 6 |
CopyRect | SUB (D, Image, S) | D и S это QRECTs, Image может быть QImage, QCanvas, или QBitmap | 3 |
Draw | SUB (x%, y%, BMP) | Выводит рисунок на "холст" (Рисовать BitMap on Canvas) | 3 |
FillRect | SUB (x1%, y1%, x2%, y2%, c%) | Рисует и заливает цветом прямоугольник | 5 |
Line | SUB (x1%, y1%, x2%, y2%, c%) | Рисует линию | 5 |
Paint | SUB (x%, y%, c%, borderc%) | Заполняет область | 4 |
Pset | SUB (x%, y%, c%) | Рисует точку | 3 |
Rectangle | SUB (x1%, y1%, x2%, y2%, c%) | Рисует прямоугольник | 5 |
RoundRect | SUB (x1%, y1%, x2%, y2%, x3%, y3%, c%) | Рисует & Заполняет цветом прямоугольник со скругленными углами | 7 |
StretchDraw | SUB (Rect AS QRECT, BMP) | Рисует BMP и растягивает его до заполнения заданного прямоугольника | 2 |
TextHeight | FUNCTION (Text$) AS WORD | Возвращает высоту, в пикселях, строки Text$ | 1 |
TextWidth | FUNCTION (Text$) AS WORD | Возвращает ширину, в пикселях, строки Text$ | 1 |
TextRect | SUB (Rect AS QRECT, x%, y%, S$, fc%, bc%) | Выводит текст, обрезая по границам региона Rect | 6 |
TextOut | SUB (x%, y%, S$, fc%, bc%) | Writes text to printer | 5 |
Printer Примеры
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