Einzelnen Beitrag anzeigen

Namenloser

Registriert seit: 7. Jun 2006
Ort: Karlsruhe
3.724 Beiträge
 
FreePascal / Lazarus
 
#8

AW: [GR32] How to blend two TBitmap32s

  Alt 19. Sep 2010, 18:38
I think this should do it, but I haven't tested it:
Delphi-Quellcode:
function ColorAlgebra(F, B, M: TColor32): TColor32;
begin
  // 1. multiply
  Result := ColorModulate(F, B);
  // 2. blend
  Result := BlendRegEx(Result, B, M);
end;
[edit]
Only your assumption that alpha=0 would result in picture 2 is false. What you'd really get is a picture that has the background in the middle and then fades to solid black near the edges. Nowhere in this picture you'd see anything white.
Because if you did, then you'd logically also have some white in it when alpha>0, which is what happens in 3 and 4.
[/edit]

Geändert von Namenloser (19. Sep 2010 um 18:46 Uhr)
  Mit Zitat antworten Zitat