User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Pascal and Delphi section within the Software Development category of DaniWeb, a massive community of 374,572 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,817 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Pascal and Delphi advertiser:
Mar 18th, 2006
Views: 2,662
This code disables font smoothing for a TLabel component. Can easily be converted for other VCL controls.

Loren Soth
delphi Syntax
  1. procedure TForm1.DisableFontSmoothing(LabelName: TLabel);
  2. var
  3. tagLOGFONT: TLogFont;
  4. begin
  5. GetObject(LabelName.Font.Handle, SizeOf(TLogFont), @tagLOGFONT);
  6. tagLOGFONT.lfQuality := NONANTIALIASED_QUALITY;
  7. LabelName.Font.Handle := CreateFontIndirect(tagLOGFONT);
  8. end;
  9.  
  10. //Example Use for Label2
  11. procedure TForm1.Button1Click(Sender: TObject);
  12. begin
  13. DisableFontSmoothing(Label2);
  14. end;
Post Comment

Only community members can submit or comment on code snippets. You must register or log in to contribute.

DaniWeb Marketplace (Sponsored Links)
All times are GMT -4. The time now is 5:55 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC