随笔 - 2146  文章 - 97 评论 - 11767 trackbacks - 253

本例效果图:


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.

posted on 2008-05-20 18:27  万一  阅读(...)  评论(...编辑  收藏