Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Library: Grafik / Sound / Multimedia (https://www.delphipraxis.net/21-library-grafik-sound-multimedia/)
-   -   Delphi Farbe invertieren (https://www.delphipraxis.net/36625-farbe-invertieren.html)

FastJack2 22. Dez 2004 19:33


Farbe invertieren
 
Ergänzend zu diesem thread hier nochmal eine Funktion zum Invertieren von Farben, die ein wenig schneller sein sollte als die anderen Beiden, da sie sich der XOR-Operation bedient:

Delphi-Quellcode:
function invertcolor(color: TColor):TColor;
begin
  Result := ColorToRGB(Color) xor $00FFFFFF;
end;
The-X hat noch folgende Assembler-Variante, die möglicherweise schneller ist:

Delphi-Quellcode:
function invertcolor(color: TColor):TColor;Assembler;
asm
  CALL ColorToRGB
  XOR EAX, $00FFFFFF;
end;
[edit=Chakotay1308]Ergänzungen. Mfg, Chakotay1308[/edit]


Alle Zeitangaben in WEZ +1. Es ist jetzt 10:23 Uhr.

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