[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details

possible? Loading a Timagelist at runtime and save it

Asked by pka4916 in Delphi Programming, Delphi Components, Graphics and Delphi Programming

I have a
Timagelist, and loading 4000 png files in it.. which takes about 5 seconds or more.
is it possible to load them and save it as 1 item  so that the reloading doesn't take 5 or more
seconds everytime?

i've been reading about saving it as 1 and then load it,  but i don't know how.

also  the png files are 32x32  but wants them in 24x24,  but i can't find the crop/resize option. in the control.
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
procedure Tdsmainform.loadcovers;
var
  SL: TStringList;
  Png: TPngObject;
  Bmp: TBitmap;
//  List: TImageList;
  Start: Cardinal;
  i: Integer;
begin
  SL := TStringList.Create;
  Png := TPngObject.Create;
  Bmp := TBitmap.Create;
  iconList := TImageList.CreateSize(24, 24);
  try
    SL.LoadFromFile('d:\List.txt');
    Start := GetTickCount;
    Bmp.Width := SL.Count * 24;
    Bmp.Height := 24;
    for i := 0 to SL.Count - 1 do
    begin
      Png.LoadFromFile('d:\pics\'+SL[i]);
      Bmp.Canvas.Draw(i * 24, 0, Png);
    end;
    iconList.AllocBy := 4000;
    iconList.Masked := False;
    iconList.Add(Bmp, nil);
    Caption := IntToStr(GetTickCount - Start);
    for i := 0 to iconList.Count - 1 do
      iconList.Draw(Canvas, i * iconList.Width mod ClientWidth,
        (i * iconList.Width div ClientWidth) * iconList.Height, i);
  finally
 
    Bmp.Free;
    Png.Free;
    SL.Free;
  end;
end;
[+][-]07/21/09 07:58 PM, ID: 24911247Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07/21/09 09:30 PM, ID: 24911581Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07/21/09 10:13 PM, ID: 24911724Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07/22/09 06:05 AM, ID: 24914259Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07/22/09 12:16 PM, ID: 24918579Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07/22/09 01:01 PM, ID: 24919011Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091111-EE-VQP-89 - Hierarchy / EE_QW_3_20080625