Thema: Delphi Farbwert zu Dezimal

Einzelnen Beitrag anzeigen

Klaus01

Registriert seit: 30. Nov 2005
Ort: München
5.755 Beiträge
 
Delphi 10.4 Sydney
 
#50

AW: Farbwert zu Dezimal

  Alt 29. Mär 2019, 13:03
.. das mit der Hilfsvariablen ist eine gute Idee:

Delphi-Quellcode:
           for y:= 0 to h do
             for x := 0 to w do
               begin

                 alpha := ((imgSpectrum[x,y] and $FF000000) shr 24) and $FF;
                 _alpha := alpha - d;
                // if alpha < 0 then
                // alpha := 0;
                 c := imgSpectrum[x,y] and $FFFFFF;
                 if _alpha > 127 then
                   imgSpectrum[x,y] := c or ((alpha -256) shl 24)
                 else
                   imgSpectrum[x,y] := c or (alpha shl 24);
               end;
Wobei _alpha vom type smallInt ist, alpha ist weiterhin ein Byte.

Grüße
Klaus
Klaus
  Mit Zitat antworten Zitat