Einzelnen Beitrag anzeigen

WojTec

Registriert seit: 17. Mai 2007
482 Beiträge
 
Delphi XE6 Professional
 
#7

Re: [GR32] How to add intensity?

  Alt 22. Jan 2010, 17:59
@jfheins, I'm doing something wrong :

Delphi-Quellcode:
var
  Row: PBGRAQuad;
  Color: TBGRAQuad;
  I, J: Integer;
  B: Byte;
  C: TColor;
begin
  Color := ColorToTriple24(AColor);
  Row := PBGRAQuad(@ASource.Bits[0]);

  for I := 0 to ASource.Height - 1 do
  begin
    for J := 0 to ASource.Width - 1 do
    begin
      B := (Row.R + Row.G + Row.B) div 3;
      C := TColor(Round((1 - (APercent / 100)) * RGB(Row.R, Row.G, Row.B) + (APercent / 100) * (RGB(Color.R, Color.G, Color.B) * B)));

      Row.R := GetRValue(C);
      Row.G := GetGValue(C);
      Row.B := GetBValue(C);

      Inc(Row);
    end;
  end;
end;
@fkerber, Ok, I'll remmeber.
  Mit Zitat antworten Zitat