📄 graystringunit.pas
字号:
unit GrayStringUnit;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls;
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);
var
Str: PChar; // points to the string to be drawn
begin
{initialize the string pointer}
Str := 'Delphi Rocks!';
{initialize the brush used to draw the string}
Canvas.Brush.Color := clRed;
{draw the string}
GrayString(Canvas.Handle, Canvas.Brush.Handle, NIL, LPARAM(Str), Length(Str),
10, 10, 0, 0);
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -