delphi win32api编程
源代码在线查看: strokepathu.pas
unit StrokePathU;
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 to be used in outlining the path}
Canvas.Pen.Color := clRed;
Canvas.Pen.Style := psSolid;
{outline the path}
StrokePath(Canvas.Handle);
end;
end.