I have (.res) File that contains some icons, I want to use these icons
with a n imagelist component ,
I have tried this but never success
ImageList1.FileLoad(rtIcon,'c:\app\res\icons.res',0)
this function always returns false , any help will be very appreciated
Try this . I use this kind of thing all the time as the images "disappear"
when I deploy my project. So I put them in a res file and then load
them
into the imagelist at startup.
______________________________________________________________________
var
Bitmap1 : TBITMAP;
Bitmap2 : TBITMAP;
Bitmap3 : TBITMAP;
Bitmap4 : TBITMAP;
begin
Bitmap1 := TBitMap.Create;
Bitmap2 := TBitmap.Create;
Bitmap3 := TBitmap.Create;
Bitmap4 := TBitmap.Create;
Try
Bitmap1.Handle := LoadBitmap(HInstance,'PAGE1');
Bitmap2.Handle := LoadBitmap(HInstance,'PAGE2');
Bitmap3.Handle := LoadBitmap(HInstance,'PAGE1');
Bitmap4.Handle := LoadBitmap(HInstance,'PAGE2');
Bitmap3.Mask(clPurple);
Bitmap4.Mask(clPurple);
ImageList1.Width := 24;
ImageList1.Height := 24;
ImageList1.Add(Bitmap1,Bitmap3);
ImageList1.Add(Bitmap2,Bitmap4);
PageControl1.ImageList :=
ImageList1;
Finally
Bitmap1.Free;
Bitmap2.Free;
Bitmap3.Free;
Bitmap4.Free;
end;