📄 pjimage.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 PJImage;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, PSJob, PJBitmap, ExtCtrls;
type
TCustomImagePrintJob = class(TCustomBitmapPrintJob)
private
{ Private declarations }
FImage: TImage;
procedure SetImage(const Value: TImage);
protected
{ Protected declarations }
procedure Notification(AComponent: TComponent; Operation: TOperation); override;
property Image: TImage read FImage write SetImage;
public
{ Public declarations }
procedure GetBitmap(const Bitmap: TBitmap); override;
published
{ Published declarations }
end;
TImagePrintJob = class(TCustomImagePrintJob)
published
// TCustomImagePrintJob properties
property Image;
// 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 DefaultDrawing;
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 TCustomImagePrintJob.SetImage(const Value: TImage);
begin
if Value<>FImage then
begin
FImage:=Value;
UpdateBitmap;
end;
end;
procedure TCustomImagePrintJob.Notification(AComponent: TComponent; Operation: TOperation);
begin
if (AComponent=FImage) and (Operation=opRemove) and not (csDestroying in ComponentState) then Image:=nil;
end;
procedure TCustomImagePrintJob.GetBitmap(const Bitmap: TBitmap);
begin
if Assigned(Bitmap) and Assigned(FImage) then
with FImage,Bitmap,Canvas do
begin
Width:=Picture.Width;
Height:=Picture.Height;
Perform(WM_PAINT,Handle,0);
end
else ClearBitmap;
end;
procedure Register;
begin
RegisterComponents('Print Jobs', [TImagePrintJob]);
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -