This example effect chart:
Code files:Unit Unit1;
Interface
Uses
Windows, Messages, sysutils, variants, Classes, Graphics, Controls, Forms,
Dialogs, Comctrls, Stdctrls, Extctrls;
Type
TForm1 = Class (Tform)
Panel1:tpanel;
Button1:tbutton;
Trackbar1:ttrackbar;
Trackbar2:ttrackbar;
Trackbar3:ttrackbar;
Trackbar4:ttrackbar;
Trackbar5:ttrackbar;
Trackbar6:ttrackbar;
Procedure Formcreate (Sender:tobject);
Procedure Formpaint (Sender:tobject);
Procedure Trackbar1change (Sender:tobject);
Procedure Trackbar2change (Sender:tobject);
Procedure Trackbar3change (Sender:tobject);
Procedure Trackbar4change (Sender:tobject);
Procedure Trackbar5change (Sender:tobject);
Procedure Trackbar6change (Sender:tobject);
End
Var
Form1:tform1;
Implementation
{$R *.DFM}
Uses Gdipobj, GDIPAPI;
Procedure Tform1.formcreate (Sender:tobject);
Const
n = 40;
Begin
Trackbar1.min: =-N;
Trackbar1.max: = n;
Trackbar2.min: =-N;
Trackbar2.max: = n;
Trackbar3.min: =-N;
Trackbar3.max: = n;
Trackbar4.min: =-N;
Trackbar4.max: = n;
Trackbar5.min: =-N;
Trackbar5.max: = n;
Trackbar6.min: =-N;
Trackbar6.max: = n;
Trackbar1.position: = 10;
Trackbar2.position: = 0;
Trackbar3.position: = 0;
Trackbar4.position: = 10;
Trackbar5.position: = 0;
Trackbar6.position: = 0;
Button1.onclick: = formcreate;
End
Procedure Tform1.formpaint (Sender:tobject);
Var
G:tgpgraphics;
Img:tgpimage;
Tb:tgptexturebrush;
Matrix:tgpmatrix;
M11, M12, M21, M22, DX, dy:single;
Begin
G: = Tgpgraphics.create (Canvas.handle);
IMG: = tgpimage.create (' c:\temp\small.png ');
TB: = Tgptexturebrush.create (IMG);
M11: = TRACKBAR1.POSITION/10;
M12: = TRACKBAR2.POSITION/10;
M21: = TRACKBAR3.POSITION/10;
M22: = TRACKBAR4.POSITION/10;
DX: = trackbar5.position * 10;
DY: = trackbar6.position * 10;
Matrix: = Tgpmatrix.create (M11, M12, M21, M22, DX, dy);
Tb. SetTransform (matrix);
G.fillrectangle (TB, 0, 0, clientwidth-panel1.width, clientheight);
Matrix. Free;
Img. Free;
Tb. Free;
G.free;
End
Procedure Tform1.trackbar1change (Sender:tobject);
Begin
Repaint;
End
Procedure Tform1.trackbar2change (Sender:tobject);
Begin
Repaint;
End
Procedure Tform1.trackbar3change (Sender:tobject);
Begin
Repaint;
End
Procedure Tform1.trackbar4change (Sender:tobject);
Begin
Repaint;
End
Procedure Tform1.trackbar5change (Sender:tobject);
Begin
Repaint;
End
Procedure Tform1.trackbar6change (Sender:tobject);
Begin
Repaint;
End
End.