Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Library: Grafik / Sound / Multimedia (https://www.delphipraxis.net/21-library-grafik-sound-multimedia/)
-   -   Delphi Microsoft ClearType ein/aus (https://www.delphipraxis.net/37489-microsoft-cleartype-ein-aus.html)

supermuckl 6. Jan 2005 14:23


Microsoft ClearType ein/aus
 
Für alle, die auf ein Canvas einen Text zeichnen und nicht wollen, das der mit ClearType gezeichnet wird.
Sinnvoll für eventuelle grafischen Filter danach, da Cleartype den text mit einen Antialiasing Effekt auf das Canvas zeichnen lässt.


Mit ClearType kann man wählen, ob es an, oder aus sein soll.

Delphi-Quellcode:
procedure ChangeCleartype(canvas:Tcanvas;ClearType:boolean);
var
  lf: TLogFont;
  tf: TFont;
begin
  tf := Tfont.create;
  try
    tf.Assign(canvas.font);
    GetObject(tf.Handle, sizeof(lf), @lf);
    if ClearType then
      lf.lfQuality := DEFAULT_QUALITY
    else
      lf.lfQuality := NONANTIALIASED_QUALITY;
    tf.Handle := CreateFontIndirect(lf);
    canvas.font.assign(tf);
  finally
    tf.Free;
  end;
end;
http://msdn.microsoft.com/library/de...ntext_0xgn.asp

[edit=Chakotay1308]Code für die Code-Library lesbarer gemacht. Mfg, Chakotay1308[/edit]


Alle Zeitangaben in WEZ +1. Es ist jetzt 11:24 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz