Delphi and DirectX Delphix (7): Final scheme for loading pictures for tdximagelist
This example effect chart:
Code files:
Unit Unit1
Interface
uses
Windows, Messages, sysutils, variants, Classes, Graphics, Controls, Forms ,
Dialogs, Dxdraws, Stdctrls;
Type
TForm1 = Class (Tform)
Dxdraw1:tdxdraw;
Dximagelist1:tdximagelist;
Button1:tbutton;
Procedure formcreate (sender:tobject);
Procedure Button1Click (sender:tobject);
End;
Var
Form1:tform1
Implementation
{$R *.DFM}
Procedure tform1.formcreate (sender:tobject);
Cons T
ImgPath1 = ' C:\Temp\DelphiX.bmp ';
ImgPath2 = ' C:\Temp\DelphiX.jpg ';
var
picitem:tpicturecollectionitem
Begin
Dximagelist1.dxdraw: = DXDRAW1;
DXIMAGELIST1.ITEMS.ADD;
Picitem: = Dximagelist1.items[dximagelist1.items.count-1];
PicItem.Picture.LoadFromFile (IMGPATH1);
DXImageList1.Items.Add;
Picitem: = Dximagelist1.items[dximagelist1.items.count-1];
PicItem.Picture.LoadFromFile (ImgPath2);
End;
Procedure Tform1.button1click (Sender:tobject);
Begin
With DXImageList1 do begin
Items[0]. Draw (dxdraw.surface, 0, 0, 0);
Items[1]. Draw (dxdraw.surface, 0, Items[0]. Height, 0);
Dxdraw.flip;
End;
End;
End.