1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
| unit Unit1;
{$MODE objfpc}{$H+}
interface
uses
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs,
BGRABitmap, BGRABitmapTypes;
type
{ TForm1 }
TForm1 = class(TForm)
procedure FormCreate(Sender: TObject);
procedure FormDestroy(Sender: TObject);
procedure FormPaint(Sender: TObject);
private
{ private declarations }
public
{ public declarations }
end;
var
Form1: TForm1;
Bitmap1: TBGRABitmap;
implementation
{$R *.lfm}
{ TForm1 }
procedure TForm1.FormCreate(Sender: TObject);
begin
Bitmap1 := TBGRABitmap.Create(400, 400);
end;
procedure TForm1.FormDestroy(Sender: TObject);
begin
Bitmap1.Free;
end;
procedure TForm1.FormPaint(Sender: TObject);
var
local: TBGRABitmap;
begin
with Bitmap1.Canvas do
begin
//Pen.Color := clWhite;
Pen.Color := clBlack;
Brush.Style := bsSolid;
//Brush.Color := clWhite;
Brush.Color := clBlack;
Rectangle(0, 0, 400, 400);
end;
local := TBGRABitmap.Create(200, 200);
local.FillEllipseAntialias(100, 100, 90, 90, CSSDarkBlue);
Bitmap1.PutImage(100, 100, local, dmDrawWithTransparency);
local.Free;
Bitmap1.Draw(Form1.Canvas, 0, 0, True);
end;
end. |
Partager