var
Form1: TForm1;
//Help function for reading a byte from TColor
//Value specifies the color
//Shift specifies the number of bits to shift
//Example: to read the red byte from Value=$00120000, Shift must have the value 16
// ($12 will then be returned
function GetByte(Value : TColor; Shift : byte): byte;
//Auxiliary procedure for reading the red, green and blue values ??from TColor
//uses GetByte
procedure ColorToRGB(Color : TColor; var R, G, B : byte);
//Auxiliary function for creating a TColor from red, green and blue values
function RGBToColor(R, G, B : byte): TColor;
//Actual transparency function, determines the transparency color of the transparent
//Foreground if background color=BGColor and foreground color=FRColor
//TranspValue specifies the integer percentage of the transparency value
function TransparencyColor(BGColor, FRColor : TColor; TranspValue : byte): TColor;
implementation
{$R *.dfm}
function GetByte(Value : TColor; Shift : byte): byte;
begin
//Mask the byte at the appropriate location and then move it to the right
Result := (Value and ($FF shl Shift)) shr Shift;
end;
procedure ColorToRGB(Color : TColor; var R, G, B : byte);
begin
R := GetByte(Color, 16); //second byte from color (from right)
G := GetByte(Color, 8); //third byte from color (from right)
B := GetByte(Color, 0); //fourth byte from color (from right)
end;
function RGBToColor(R, G, B : byte): TColor;
begin
Result := ((R and $FF) shl 16) +
((G and $FF) shl 8) + (B and $FF);
end;
function TransparencyColor(BGColor, FRColor : TColor; TranspValue : byte): TColor;
var
BGR, BGG, BGB, FRR, FRG, FRB, ergR, ergG, ergB : byte;
TrFact : real;
begin
//Calculate transparency factor
TrFact := TranspValue / 100;
//Split background and foreground colors into red, green and blue values
ColorToRGB(BGColor, BGR, BGG, BGB);
ColorToRGB(FRColor, FRR, FRG, FRB);
//Calculate result color values
ergR := byte(Trunc(BGR * TrFact + FRR * (1 - TrFact)));
ergG := byte(Trunc(BGG * TrFact + FRG * (1 - TrFact)));
ergB := byte(Trunc(BGB * TrFact + FRB * (1 - TrFact)));
//Red, green and blue value to TColor and return
Result := RGBToColor(ErgR, ergG, ergB);
end;

Get Tranzparency Color
Abonnieren
Posts (Atom)
Beliebte Posts
-
Windows Key Sniffer 0.82 - Update 08/2024 Der Windows Key Sniffer hat mir im Laufe der Zeit viel Arbeit erspart und unterstützt, viele Wi...
-
Network Source Code Update Source Code Network Update : https://asciigen.blogspot.com/p/network.html Send Message 1.0 Source Server Client ...
-
Windows Defender Bypass Version 0.75 - Update 11/2024 Den Windows 10-eigenen Virenschutz Defender kann man auf mehreren Wegen abschalt...
-
ASCii GIF Animator Update Version 0.68 (32 bit) - 11/2024 Bei dieser überarbeiteten Version ist die Kompatibilität zu den verschiedenen...
-
MD5 Hacker v.0.26 - Update 08.2024 MD5 Hashs sollten eigentlich nicht entschlüsselt werden können. Jedoch gibt es Tools, mit welchen auch ...
-
Dir Sniffer Version 0.11 - Update 02/2025 Dir Sniffer ist ein kleines aber nützliches Tool um herauszufinden, was ihr Programm auf ihrem...
-
Host Editor Version 0.65 - Update 01/2025 Hosts File Editor allows for the easy editing of host files and backup creation. Create your ...
-
Oldskool Font Generator v.0.29 - Update 11/2023 Das Tool stell 508 Bitmap Fonts zu Verfügung. Eigene Fonts können integriert werden, sie...
-
Hard Crypter 0.19 - Update 12/2023 Mit diesem Tool können Sie jede beliebige Datei auf dem Windows-System verschlüsseln. Die Byte-Erse...
Keine Kommentare:
Kommentar veröffentlichen