unit StrokeAndFillPathU;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs;
type
TForm1 = class(TForm)
procedure FormPaint(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.FormPaint(Sender: TObject);
begin
{begin a path bracket}
BeginPath(Canvas.Handle);
{draw some cool text}
SetBkMode(Canvas.Handle, TRANSPARENT);
Canvas.TextOut(10, 10, 'DELPHI ROCKS!');
{end the path bracket}
EndPath(Canvas.Handle);
{initialize the pen and brush to be used in filling and outlining the path}
Canvas.Pen.Color := clRed;
Canvas.Pen.Style := psSolid;
Canvas.Brush.Color := clBlue;
Canvas.Brush.Style := bsDiagCross;
{fill and outline the path}
StrokeAndFillPath(Canvas.Handle);
end;
end.