This example effect chart (the actual effect is quite smooth, GIF can only explain an action trend):
Code files:
Unit Unit1
Interface
uses
Windows, Messages, sysutils, variants, Classes, Graphics, Controls, Forms ,
Dialogs, Dxdraws, Stdctrls, Dxclass, Comctrls;
Type
TForm1 = Class (Tform)
Dxdraw1:tdxdraw;
Dximagelist1:tdximagelist;
Dxtimer1:tdxtimer;
Procedure formcreate (sender:tobject);
Procedure Dxtimer1timer (sender:tobject; Lagcount:integer);
End;
Var
Form1:tform1
Implementation
{$R *.DFM}
var
picitem:tpicturecollectionitem;
angle:cardinal;
Procedure Tform1.formcreate (sender:tobject);
Const
ImgPath1 = ' C:\Temp\DelphiX.bmp ';
begin
Dxdraw1.align: = alclient;
Dxtimer1.interval: = 0;
Dximagelist1.dxdraw: = DXDRAW1;
Picitem: = Tpicturecollectionitem (DXIMAGELIST1.ITEMS.ADD);
PicItem.Picture.LoadFromFile (IMGPATH1);
End;
Procedure Tform1.dxtimer1timer (sender:tobject; Lagcount:integer);
Begin
DXDraw1.Surface.Fill (0);
Picitem.drAwrotate (dxdraw1.surface,
Dxdraw1.width Div 2, Dxdraw1.height Div 2, {location}
Picitem.width, Pic Item.height, {size}
0, {color palette}
0.5, 0.5, {Rotation Center: 0..1}< br> Byte (Angle)); {Rotation angle 0..255}
Inc (Angle);
Dxdraw1.flip;
End;
End.