Jump to content


Photo

ANTIALIASED_QUALITY


  • Please log in to reply
2 replies to this topic

#1 flavsouvou

flavsouvou

    Senior Member

  • Members
  • PipPip
  • 207 posts

Posted 12 November 2010 - 08:58 PM

Hi Boki,

I need fonts with ANTIALIASED_QUALITY in NexGrid and NxHTMLLabel.

This code may help, it works to set ANTIALIASED_QUALITY for a TLabel.

CODE
unit AntiAliasedLabel;

interface

uses
  Windows, Messages, SysUtils, Controls, StdCtrls, Graphics;

type
  TLabel = class(StdCtrls.TLabel)
  private
    fFontChanged: boolean;
  public
    procedure Paint; override;
  end;

implementation

procedure TLabel.Paint;
var
  LF: TLogFont;
begin

  
  if self.caption = 'Coucou' then
  if not fFontChanged then
    begin


    Win32Check(GetObject(Font.Handle, SizeOf(TLogFont), @LF) <> 0);
    LF.lfQuality := 4;  //ANTIALIASED_QUALITY=4;
    Font.Handle := CreateFontIndirect(LF);
    fFontChanged := TRUE;
  end;

  inherited;

end;

end.


Thanks for help.


#2 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,289 posts
  • Gender:Male

Posted 27 November 2010 - 06:23 PM

Hello,

(Please sorry for delay)

Doesn't label already have anti-aliasing when ClearType is ON?

Best regards
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#3 flavsouvou

flavsouvou

    Senior Member

  • Members
  • PipPip
  • 207 posts

Posted 29 November 2010 - 11:08 AM

Hi Boki,

Yes but XP has Cleartype OFF by default
that's why I was asking to have an ANTIALIASED_QUALITY property for your components.

Thanks





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users