I\'m using a custom gauge, based on the example that came with Delphi (5 Enterprise). For those that don\'t know, it\'s like a smooth progress bar, but displays the percenta
Specifying NONANTIALIASED_QUALITY
in the LOGFONT
structure should turn antialiasing off:
procedure SetFontQuality(Font: TFont; Quality: Byte);
var
LogFont: TLogFont;
begin
if GetObject(Font.Handle, SizeOf(TLogFont), @LogFont) = 0 then
RaiseLastOSError;
LogFont.lfQuality := Quality;
Font.Handle := CreateFontIndirect(LogFont);
end;
procedure TForm1.PaintBox1Paint(Sender: TObject);
const
FontQualities: array[Boolean] of Byte = (DEFAULT_QUALITY, NONANTIALIASED_QUALITY);
var
Canvas: TCanvas;
begin
Canvas := (Sender as TPaintBox).Canvas;
SetFontQuality(Canvas.Font, FontQualities[CheckBox1.Checked]);
Canvas.TextOut(12, 12, 'Hello, world!');
end;