kein problem. hier eine prozedure von mir:
der parameter Alpha gibt die transparenz an (0-255):
Delphi-Quellcode:
procedure MergeBmp(Src1, Src2, Dest: TBitmap; Alpha: Byte);
type
TARGB = packed record b, g, r, a: Byte end;
var
s1, s2, d: ^TARGB;
nAlpha: Byte;
i: Integer;
begin
if not (Assigned(Src1) or Assigned(Src2) or Assigned(Dest)) then Exit;
if (Src1.Width<>Src2.Width) or (Src1.Height<>Src2.Height) then Exit;
Src1.PixelFormat:=pf32bit;
Src2.PixelFormat:=pf32bit;
Dest.PixelFormat:=pf32bit;
Dest.Width:=Src1.Width;
Dest.Height:=Src1.Height;
s1:=Src1.ScanLine[Src1.Height-1];
s2:=Src2.ScanLine[Src2.Height-1];
d:=Dest.ScanLine[Dest.Height-1];
nAlpha:=not Alpha;
for i:=1 to Dest.Width*Dest.Height do begin
d.b:=(s1.b*nAlpha + s2.b*Alpha) shr 8;
d.g:=(s1.g*nAlpha + s2.g*Alpha) shr 8;
d.r:=(s1.r*nAlpha + s2.r*Alpha) shr 8;
Inc(s1);
Inc(s2);
Inc(d);
end;
end;