取消平滑字体边缘和抗锯齿
disable font smoothing/anti-aliasing?
Author: Andy
procedure TForm1.DisableFontSmoothing(LabelName: TLabel);
var
tagLOGFONT: TLogFont;
begin
GetObject(LabelName.Font.Handle, SizeOf(TLogFont), @tagLOGFONT);
tagLOGFONT.lfQuality := NONANTIALIASED_QUALITY;
LabelName.Font.Handle := CreateFontIndirect(tagLOGFONT);
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
Label1.Caption := 'FONT';
Label2.Caption := Label1.Caption;
Label1.Font.Size := 100;
Label2.Font.Size := 100;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
DisableFontSmoothing(Label2);
end;