Delphi and DirectX Delphix (7)

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.