unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, JvExControls, JvComponent, JvPrvwDoc, ExtCtrls,
JvComponentBase, JvPrvwRender,printers;
type
TForm1 =
class(TForm)
JvPreviewControl1: TJvPreviewControl;
Button1: TButton;
Image1: TImage;
JvPreviewRenderControl1: TJvPreviewRenderControl;
JvPreviewPrinter1: TJvPreviewPrinter;
procedure Button1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
Image1.Canvas.Brush.Color:=CLblue;
Image1.Canvas.Ellipse(0,0,Image1.Width,Image1.Height);
JvPreviewRenderControl1.CreatePreview(True);
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
with TPrintDialog.Create(
nil)
do
try
if Execute
then
begin
JvPreviewPrinter1.Printer:=Printer;
JvPreviewPrinter1.Print;
end;
finally
Free;
end;
end;
end.