9
980
Unregistered / Unconfirmed
GUEST, unregistred user!
uses printers;<br>procedure TF_lzdlgj.SpeedButton8Click(Sender: TObject);<br>var<br> Bitmap: TBitmap;<br> /////////打印image<br> ScaleX, ScaleY: Integer;<br> R: TRect;<br> /////打印image<br>begin<br> Bitmap := TBitmap.Create;<br> Bitmap.Width := Panel1.Width;<br> Bitmap.Height := Panel1.Height;<br> try<br> Panel1.PaintTo(Bitmap.Canvas,0,0);<br> Bitmap.SaveToFile('c:/jjj.bmp');<br> //Use Bitmap Do SomeThing..<br> finally<br> Bitmap.Free;<br> end;<br> Image1.Picture.LoadFromFile('c:/jjj.bmp');<br> /////打印image<br> Printer.Canvas.Font.Size := 11;<br> Printer.Canvas.Font.Name := '宋体';<br> Printer.BeginDoc;<br> with Printer do<br> try<br> ScaleX := GetDeviceCaps(Handle, logPixelsX) div PixelsPerInch;<br> ScaleY := GetDeviceCaps(Handle, logPixelsY) div PixelsPerInch;<br> // R := Rect(500, 100, Image1.Picture.Width * ScaleX,<br> // Image1.Picture.Height * ScaleY);<br> R := Rect(130, 100, 2300,3000);<br> Canvas.StretchDraw(R, Image1.Picture.Graphic);<br> finally<br> EndDoc;<br> end;<br> /////打印image<br><br>end;<br>为什么打印窗体上面的panel 在A4的纸上面 只有 A4 的 1/4 大小呢,该怎么样做<br>我不管这个panel 多大,打印在 A4 纸是正好的,不知道大家明白不<br><br>如果换个方法也可, 有个票据,界面在窗体上面画出来了 ,要就按照这个 要求打印出来,怎么做最好,省力