unit Unit1;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs,
BGRABitmap, BGRABitmapTypes;
type
{ TForm1 }
TForm1 = class(TForm)
procedure FormPaint(Sender: TObject);
private
{ private declarations }
public
{ public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.lfm}
{ TForm1 }
procedure TForm1.FormPaint(Sender: TObject);
var image: TBGRABitmap;
begin
image := TBGRABitmap.Create(10,10);
with image.Canvas do
begin
//clear with white
brush.color := clWhite;
FillRect(0,0,image.width,image.height);
//blue ellipse with black border
brush.style := bsClear;
pen.color := clBlack;
Ellipse(0,0,9,9);
end;
// stretch the image so we can see the pixels
BGRAReplace(image,image.Resample(image.Width*10,image.Height*10,rmSimpleStretch));
image.Draw(Canvas,0,0,True);
image.free;
end;
end.