标签:
感受一下区别:
procedure TForm1.Timer2Timer(Sender: TObject); var cvs: TCanvas; Rect: TRect; Str: string; begin EXIT; cvs := TCanvas.Create; cvs.Handle := GetDC(0); SetBkMode(cvs.Handle, TRANSPARENT); //cvs.Font.Name := ‘宋体‘; cvs.Font.Style := [fsBold, fsItalic]; cvs.Font.Size := 48; Randomize; cvs.Font.Color := Random($FFFFFF); Rect := Screen.DesktopRect; Str := ‘万一的 Delphi 博客‘; cvs.TextRect(Rect, 300, 300, Str); cvs.Free; end;
改成OPAQUE以后,没感觉有什么区别,待续。。。
SetBkMode可设置文字背景色:TRANSPARENT或OPAQUE
标签:
原文地址:http://www.cnblogs.com/findumars/p/5360914.html