Page 80 - 4260
P. 80

Листинг модуля форми
           unit Prg_1_3_;
           interface
           uses
             Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
             Dialogs, StdCtrls, ExtCtrls;
           type
                  TForm1 = class(TForm)
                         Sozdath: TButton;
                         Image1: TImage;
                         Smotreth: TButton;
                         procedure SozdathClick(Sender: TObject);
                         procedure SmotrethClick(Sender: TObject);
                         private
                                { Private declarations }
                         public
                                { Public declarations }
                  end;
           var
                  Form1: TForm1;
                  MyMetafile:TMetafile;

           implementation

           {$R *.dfm}

           procedure TForm1. SozdathClick(Sender: TObject);
           begin
                  with TMetafileCanvas.Create(MyMetafile, 0) do
                         try
                                Brush.Color := clRed;
                                Ellipse(0,0,150,100);
                         // Малюємо еліпс
                                Brush.Color:=clWhite;
                                Rectangle(150,150,200,200);
                  // Малюємо квадрат
                         finally
                                Free
                         end;
                  MyMetafile.SaveToFile('MyMetafile.wmf');         //
           Зберегти метафайл
                                          80
   75   76   77   78   79   80   81   82   83