J'ai essayé le code suivant :
1 2 3 4 5 6 7 8 9 10 11 12
|
ILButtons.Clear;
ButtonPng:=TPNGObject.Create;
ButtonPng.LoadFromFile(SkinPath+'b_number_n.png');
Button:=TImage.Create(self);
IlButtons.ColorDepth:=cd32Bit;
IlButtons.BlendColor:=clNone;
IlButtons.BkColor:=clnone;
Button.Picture.Graphic:=ButtonPng;
ILButtons.Add(Button.Picture.Bitmap,nil);
Button.free;
ButtonPng.Free; |
mais j'ai l'erreur suivante :
Taille d'image incorrecte
si j'ajoute le ligne :
showmessage(inttostr(Button.Picture.Bitmap.Height));
il me renvoie 0
Si je teste :
1 2 3 4 5 6 7 8 9 10 11 12 13
|
ILButtons.Clear;
ButtonPng:=TPNGObject.Create;
ButtonPng.LoadFromFile(SkinPath+'b_number_n.png');
Button:=TImage.Create(self);
IlButtons.ColorDepth:=cd32Bit;
IlButtons.BlendColor:=clNone;
IlButtons.BkColor:=clnone;
Button.Canvas.Draw(0, 0, ButtonPng);
ILButtons.Add(Button.Picture.Bitmap,nil);
Button.free;
ImagePng.free;
ButtonPng.Free; |
les bords des boutons ne sont pas transparents et ne laissent pas voir la form qui est derrière mais blancs.
Partager