TPictureCollectionItem.DrawRotate(); 的同类函数还有:
TPictureCollectionItem.DrawRotateAdd();
TPictureCollectionItem.DrawRotateSub();
TPictureCollectionItem.DrawRotateAlpha();
TPictureCollectionItem.DrawRotateAddCol();
TPictureCollectionItem.DrawRotateSubCol();
TPictureCollectionItem.DrawRotateAlphaCol();
This example is demonstrated separately, the Operation 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;
Button2:tbutton;
Button3:tbutton;
Button4:tbutton;
Button5:tbutton;
Button6:tbutton;
Button7:tbutton;
procedure formcreate (sender:tobject);
procedure Button1Click (sender:tobject);
procedure Button2click (sender:tobject);
procedure Button3click (sender:tobject);
procedure Button4click (sender:tobject);
procedure Button5click (sender:tobject);
procedure Button6click (sender:tobject);
procedure Button7click (sender:tobject);
end;
var
Form1:tform1;
Implementation
{$R *.DFM}
Const
Angle = 32; {Here corresponds to 45° angle}
clr = $777777;
var
Picitem:tpicturecollectionitem;
procedure Tform1.formcreate (sender:tobject);
Const
ImgPath1 = ' C:\Temp\DelphiX.bmp ';
begin
Dximagelist1.dxdraw: = DXDRAW1;
Picitem: = Tpicturecollectionitem (DXIMAGELIST1.ITEMS.ADD);
PicItem.Picture.LoadFromFile (IMGPATH1);
button1.caption: = ' drawrotateadd ';
button2.caption: = ' drawrotatesub ';
button3.caption: = ' drawrotatealpha ';
button4.caption: = ' drawrotateaddcol ';
button5.caption: = ' drawrotatesubcol ';
button6.caption: = ' drawrotatealphacol ';
button7.caption: = ' original effect ';
end;
procedure Tform1.button1click (sender:tobject);
begin
DXDraw1.Surface.Fill (CLR);
Picitem.drawrotateadd (Dxdraw1.surface,
dxdraw1.width Div 2, Dxdraw1.height Div 2,
picitem.width, Picitem.height,
0,
0.5, 0.5,
Angle);
Dxdraw1.flip;
end;
procedure Tform1.button2click (sender:tobject);
begin
DXDraw1.Surface.Fill (CLR);
picitem.drawrotatesub (Dxdraw1.surface,
dxdraw1.width Div 2, Dxdraw1.height Div 2,
picitem.width, Picitem.height,
0,
0.5, 0.5,
Angle);
Dxdraw1.flip;
end;
procedure Tform1.button3click (sender:tobject);
begin
DXDraw1.Surface.Fill (CLR);
Picitem.drawrotatealpha (Dxdraw1.surface,
dxdraw1.width Div 2, Dxdraw1.height Div 2,
picitem.width, Picitem.height,
0,
0.5, 0.5,
Angle,
128);
Dxdraw1.flip;
end;
procedure Tform1.button4click (sender:tobject);
begin
DXDraw1.Surface.Fill (CLR);
Picitem.drawrotateaddcol (Dxdraw1.surface,
dxdraw1.width Div 2, Dxdraw1.height Div 2,
picitem.width, Picitem.height,
0,
0.5, 0.5,
Angle,
Clyellow);
Dxdraw1.flip;
end;
procedure Tform1.button5click (sender:tobject);
begin
DXDraw1.Surface.Fill (CLR);
Picitem.drawrotatesubcol (Dxdraw1.surface,
dxdraw1.width Div 2, Dxdraw1.height Div 2,
picitem.width, Picitem.height,
0,
0.5, 0.5,
Angle,
Clyellow);
Dxdraw1.flip;
end;
procedure Tform1.button6click (sender:tobject);
begin
DXDraw1.Surface.Fill (CLR);
Picitem.drawrotatealphacol (Dxdraw1.surface,
dxdraw1.width Div 2, Dxdraw1.height Div 2,
picitem.width, Picitem.height,
0,
0.5, 0.5,
Angle,
Clyellow);
Dxdraw1.flip;
end;
procedure Tform1.button7click (sender:tobject);
begin
DXDraw1.Surface.Fill (CLR);
picitem.drawrotate (Dxdraw1.surface,
dxdraw1.width Div 2, Dxdraw1.height Div 2,
picitem.width, Picitem.height,
0,
0.5, 0.5,
Angle);
Dxdraw1.flip;
end;
end.