如题。

解决方案 »

  1.   

    有个打印对象,好象是Printer,调用这个可以打印...
      

  2.   

    to:GARNETT2183(KingWolves 
    没有找到你说的东西
      

  3.   

    是TPrinter这个对象,上面写错了,详细可以看《Delphi 5开发人员》第10章,本书的电子版在
    www.2ccc.com有得下...
      

  4.   

    通过考屏的方式解决。
    如果哪位有更好的办法,请贴上来分享以下。
    下面是我写的代码:
    其中BC1就是BARCODE的控件名称。
    procedure TForm1.BitBtn1Click(Sender: TObject);
    var
        CopyFromRect: TRect;
    begin
        image1.Width :=bc1.ClientWidth ;
        image1.Height:=bc1.ClientHeight ;
        CopyFromRect.TopLeft:=point(bc1.Left,bc1.Top);
        CopyFromRect.BottomRight:=point((bc1.Left+bc1.Width),(bc1.Top+bc1.Height));
        image1.Canvas.CopyRect(image1.Canvas.ClipRect,self.Canvas,CopyFromRect);
        image1.Picture.SaveToFile('F:\aa.bmp');
        {
        printer.BeginDoc ;
        bc1.PaintTo(printer.Canvas.Handle,0,0);
        printer.EndDoc;
        }
    end;