Delphi and DirectX Delphix (14)

Source: Internet
Author: User

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.

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.