Hello, I'm trying to access the TImageList (Buttons_Iml) which I created on IDE. Parent of my TImage (AddUrl_Img) is a TPanel. The code below is in Form's OnCreate event. Here's my code so far:
with Buttons_Iml do
begin
{ColorDepth:=cd32Bit;
DrawingStyle:=dsTransparent; <-- These are giving me error, I commented in}
Scaled:=True;
ShareImages:=True;
end;
AddUrl_Img.Refresh;
with AddUrl_Pnl do
begin
Caption:='';
OnMouseDown:=@MouseDownHandler;
OnMouseUp:=@MouseUpHandler;
end;
with AddUrl_Img do
begin
Images:=Buttons_Iml;
Anchors:=[akLeft,akRight];
Center:=True;
Stretch:=True;
Proportional:=True;
Transparent:=True;
ImageIndex:=0;
Width:=80;
Height:=80;
with Images do
begin
Width:=80;
Height:=80;
Scaled:=True;
end;
end;
// Buttons_Iml.GetIcon(0, AddUrl_Img.Picture.Icon); <-- This displays blank panel
Buttons_Iml.Draw(AddUrl_Img.Canvas, 0, 0, 0); // <-- This displays black rectangle
ShowMessage(Buttons_Iml.ToString + ' ' + Buttons_Iml.Count.ToString);
AddUrl_Img.Refresh;
AddUrl_Lbl.Caption:='Add URL';
How can I correctly display the transparent png?