|
[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. |
|
|
|
|
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;
|
20091111-EE-VQP-89 - Hierarchy / EE_QW_3_20080625