⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pjform.pas

📁 GREATIS Print Suite Pro for Delphi (3-7,2005,2006,2007) and C++ Builder (3-6) Set of components for
💻 PAS
字号:
(*  GREATIS PRINT SUITE PRO                          *)
(*  unit version 1.85.008                            *)
(*  Copyright (C) 2001-2007 Greatis Software         *)
(*  http://www.greatis.com/delphicb/printsuite/      *)
(*  http://www.greatis.com/delphicb/printsuite/faq/  *)
(*  http://www.greatis.com/bteam.html                *)

unit PJForm;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Forms, PSJob, PJControl,
  Controls;

type
  TCustomFormPrintJob = class(TCustomControlPrintJob)
  private
    { Private declarations }
  protected
    { Protected declarations }
    procedure Loaded; override;
  public
    { Public declarations }
    procedure GetBitmap(const Bitmap: TBitmap); override;
  published
    { Published declarations }
  end;

  TFormPrintJob = class(TCustomFormPrintJob)
  published
    // TCustomControlPrintJob properties
    property EntireWindow;
    // TCustomBitmapPrintJob properties
    property StretchMode;
    property Scale;
    property MultiPage;
    property AlignVertical;
    property AlignHorizontal;
    // TCustomPrintJob properties
    property Title;
    property Margins;
    property MarginsUnits;
    property MarginsError;
    property Header;
    property HeaderUnits;
    property Footer;
    property FooterUnits;
    property PageMode;
    property PageWidth;
    property PageHeight;
    property PageUnits;
    property Orientation;
    property Options;
    property RelativeCoords;
    property OnCreate;
    property OnDestroy;
    property OnDraw;
    property OnPrinterSetupChange;
    property OnStartPrint;
    property OnEndPrint;
    property OnPrintProgress;
    property OnStartPrintPage;
    property OnEndPrintPage;
    property OnUpdate;
  end;

procedure Register;

implementation

procedure TCustomFormPrintJob.Loaded;
begin
  inherited;
  if not (csDesigning in ComponentState) then Control:=Owner as TControl;
end;

procedure TCustomFormPrintJob.GetBitmap(const Bitmap: TBitmap);
var
  BMP: TBitmap;
begin
  if not (csDesigning in ComponentState) then
    if Assigned(Control) and not EntireWindow then
    begin
      BMP:=TBitmap.Create;
      try
        with Control as TCustomForm do
        begin
          BMP.Width:=ClientWidth;
          BMP.Height:=ClientHeight;
          BMP.Canvas.CopyRect(ClientRect,Canvas,ClientRect);
        end;
        Bitmap.Assign(BMP);
      finally
        BMP.Free;
      end;
    end
    else inherited;
end;

procedure Register;
begin
  RegisterComponents('Print Jobs', [TFormPrintJob]);
end;

end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -