sarssor
Messages postés63Date d'inscriptiondimanche 22 juillet 2007StatutMembreDernière intervention28 avril 2011
-
21 avril 2011 à 13:20
sarssor
Messages postés63Date d'inscriptiondimanche 22 juillet 2007StatutMembreDernière intervention28 avril 2011
-
23 avril 2011 à 00:46
Salut
je voudrais faire opacité entre 2 Bitmaps mais
le valeur ne doit pas être le meme par example
de haut en bas
commet ca :
Example Je crois il faut faire masque. mais je ne sais pas comment
et voila mon code :
procedure TForm1.Button1Click(Sender: TObject);
const TransparentGrad = 0.5;
VAR oldColor, aColor: TColor;
x,y: Integer;
tmpColor1,
tmpColor2: TColor;
begin
Image3.Picture.Assign(Image2.Picture);
Image3.AutoSize := True;
for x := 0 to Image1.Picture.Width do
for y := 0 to Image1.Picture.Height do begin
oldColor := Image1.Canvas.Pixels[x,y];
aColor := Image2.Canvas.Pixels[x,y];
Image3.Canvas.Pixels[x,y] := RGB(Trunc(Max(0,GetRValue(oldColor) - TransparentGrad * GetRValue(aColor))),
Trunc(Max(0,GetGValue(oldColor) - TransparentGrad * GetGValue(aColor))),
Trunc(Max(0,GetBValue(oldColor) - TransparentGrad * GetBValue(aColor))));
end;
end;
je voudrais de coûté un peut de transparent et d autre coûté plus transparent