通上,立即结分
解决方案 »
- 请各位帮忙?如何通过修改PE方式注入DLL到某个EXE?
- 发现Delphi6/7的一个问题
- 在用Delphi+DBGRID来做数据库时,在前台如何来及时发映在后台的数据变化。先给50分,解后再给150分。
- 关于treeview在多表中动态生成树的问题大家帮帮我分不够可以加在线等待。
- MSN Messenger 6左侧的TAB是如何作出来了?
- 请教CORBA在不同局域网(或internet)怎么互联 -- UP有分
- 我的儿子两岁啦,送点什么给他作生日礼物呢,大家出点主意,要益智、健康的
- 我在装DELPHI的时候,第一次运行老是提示出错,找不到两个文件,哪位高人告诉我为什么?
- 关于在程序运行中动态为DBCOMBOBOX控件的ITEMS添加内容的问题?
- 小問題,TiniFile有Create,怎麼沒有open,該如何open??
- 如何通过编程创建自解压文件?
- 如何制作异形菜单????
Like TCanvas, the TPrinter class does not belong to BaseCLX because there are two separate versions, one for VCL applications (in the Printers unit) and one for CLX applications (in the QPrinters unit). The VCL TPrinter object encapsulates details of Windows printers. The CLX TPrinter object is a paint device that paints on a printer. It generates postscript and sends that to lpr, lp, or another print command. Both versions of TPrinter, however, are extremely similar.To get a list of installed and available printers, use the Printers property. Both printer objects use a TCanvas (which is identical to the form's TCanvas) which means that anything that can be drawn on a form can be printed as well. To print an image, call the BeginDoc method followed by whatever canvas graphics you want to print (including text through the TextOut method) and send the job to the printer by calling the EndDoc method. This example uses a button and a memo on a form. When the user clicks the button, the content of the memo is printed with a 200-pixel border around the page. To run this example successfully, add Printers to your uses clause.procedure TForm1.Button1Click(Sender: TObject);
var
r: TRect;
i: Integer;
begin
with Printer do
begin
r := Rect(200,200,(Pagewidth - 200),(PageHeight - 200));
BeginDoc;
Canvas.Brush.Style := bsClear;
for i := 0 to Memo1.Lines.Count do
Canvas.TextOut(200,200 + (i *
Canvas.TextHeight(Memo1.Lines.Strings[i])),
Memo1.Lines.Strings[i]); Canvas.Brush.Color := clBlack;
Canvas.FrameRect(r);
EndDoc;
end;
end;
===============================================================================From Delphi Help