首页  编辑  

用Delphi编写打印程序的窍门

Tags: /超级猛料/Print.打印/   Date Created:

ԼDelphiдһӡôЩɻ

1.Ȣʾǰӡķֱ

WindowsµĴӡֱԴӡҪã֪ӡķֱʣڳмһУShowMessage(ˮƽֱʡ䣫inttostr(GetDeviceCaps(printerHandle,LOGPIXELSX))chr(13)䴹ֱֱʣ䣫inttostr(GetDeviceCaps(printerHandle,LOGPIXELSY)));һĿȻˡ

2.ֱ͵ӡ

Delphiṩִӡʽһǽ͵FormٵFormprint͵ӡǽֱ͵ӡõһַʽFormPrintScalԣӡĶҲ⡣˽õڶַʽ

3.ҪʹAssignPrn

AssignPrnıӡʹӡļһ򵥡򵥴һϵеIJ㣺޷֪ǰӡ޷׼ȷо࣬޷ıεȵȡôӡCanvasԽдӡɡ

4.ôӡĵλ

ôӡκδӡ϶شӡͱıĶλù̶ĶֱͬʵĴӡЧDzͬġprinterCanvasrectangle(0,0,360,720)360360ļ4200SPܴһ1Ӣ2ӢߵľΣ600600Ļ6Lֻܴ06Ӣ12ӢߵľΡʹôӡĵΪλһǵѡ񡣾£VarPointX,PointY:integer;PointX:=GetDeviceCaps(printerHandle,LOGPIXELSX);PointY:=GetDeviceCaps(printerHandle,LOGPIXELSX);printerCanvasrectangle(0,0,PointX1,PointY2)ʹʲôĴӡܵõһ1Ӣ2ӢߵľΡ

5.ӴӡԪ

DelphiɴʱԶUSESּԪӡԪ(Printers)ȴ֮УҪʹӡͳ򲻳㻹ʵʵֹϰɡ