Bacterius
Messages postés
3792
Date d'inscription
samedi 22 décembre 2007
Statut
Membre
Dernière intervention
3 juin 2016
10
12 mars 2009 à 17:41
Oui c'est BlendOp, petite erreur de ma part.
Sinon, evidemment il faut faire procedure TForm1.AlphaBlendMyPets; ajouter la déclaration dans la fiche aussi, et ajouter 2 images remplies à ta fiche.
Ensuite, je ne sais pas pourquoi l'alphablend foire chez toi, chez moi ça marche bien ...
Je reposte la version corrigée donc :
[Ajouter 2 TImage à sa fiche, remplies d'un bitmap 200*200 chacune]
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs;
type
TForm1 = class(TForm)
Image1: TImage;
Image2: TImage;
procedure FormCreate(Sender: TObject);
private
{ Déclarations privées }
public
{ Déclarations publiques }
procedure AlphaBlendMyPets;
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.AlphaBlendMyPets;
Var
BFunc: BLENDFUNCTION;
begin
BFunc.BlendOp := AC_SRC_OVER;
BFunc.BlendFlags := 0;
BFunc.SourceConstantAlpha := 128; // Allez, 128/255 transparence :)
BFunc.AlphaFormat := 0;
AlphaBlend(Image2.Picture.Bitmap.Handle, 0, 0, 200, 200, Image1.Picture.Bitmap.Handle, 0, 0, 200, 200, BFunc);
end;
end.
Chez moi ça marche comme ça ... essaye comme ceci ?
Cordialement, Bacterius !