现在的位置: 首页 > 综合 > 正文

WinAPI: StrokePath – 描绘路径轮廓

2011年12月25日 ⁄ 综合 ⁄ 共 514字 ⁄ 字号 评论关闭
本例效果图:



unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs;

type
  TForm1 = class(TForm)
    procedure FormPaint(Sender: TObject);
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.FormPaint(Sender: TObject);
var
  DC: HDC;
begin
  Self.Color := clWhite;
  Canvas.Font.Name := '宋体';
  Canvas.Font.Size := 100;
  Canvas.Font.Style := [fsBold, fsItalic];
  Canvas.Pen.Color := clBlue;

  DC := Self.Canvas.Handle;
  BeginPath(DC);
  SetBkMode(DC, TRANSPARENT);
  Canvas.TextOut(10, 10, '博客');
  EndPath(DC);

  StrokePath(DC);
end;

end.

抱歉!评论已关闭.