Tpicturecollectionitem. similar functions of drawrotate (); Include: tpicturecollectionitem. drawrotateadd (); tpicturecollectionitem. drawrotatesub (); tpicturecollectionitem. drawrotatealpha (); tpicturecollectionitem. drawrotateaddcol (); tpicturecollectionitem. drawrotatesubcol (); tpicturecollectionitem. drawrotatealphacol ();
This example demonstrates how to run:
Code File:
Unit unit1; interfaceuses windows, messages, sysutils, variants, classes, graphics, controls, forms, dialogs, dxdraws, stdctrls; Type tform1 = Class (tform) dxdraw1: tdxdraw; Metadata: response; button1: tbutton; button2: tbutton; button3: tbutton; button4: tbutton; button5: tbutton; button6: tbutton; Response: tbutton; Procedure response (Sender: tobject ); procedure extract (Sender: tobject); Procedure button2click (Sender: tobject); Procedure extract (Sender: tobject ); procedure button6click (Sender: tobject); Procedure button7click (Sender: tobject); end; var form1: tform1; implementation {$ R *. DFM} const angle = 32; {here is equivalent 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: = 'watermark'; button2.caption: = 'watermark'; button3.caption: = 'watermark'; button4.caption: = 'watermark '; 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.
Form file:
Object form1: tform1 left = 0 Top = 0 caption = 'form1' clientheight = 226 clientwidth = 356 color = clbtnface font. charset = default_charset font. color = clwindowtext font. height =-11 font. name = 'tahoma 'font. style = [] oldcreateorder = false oncreate = formcreate pixelsperinch = 96 textheight = 13 object dxdraw1: tdxdraw left = 8 Top = 8 width = 225 Height = 211 autoinitialize = true autosize = true color = clblack display. fixedbitcount = false display. fixedratio = true display. fixedsize = true Options = [doallowreboot, dowaitvblank, docenter, do3d, dodirectx7mode, dohardware, doselectdriver] surfaceheight = 211 surfacewidth = 225 taborder = 0 traces = end object button1: tbutton left = 239 Top = 8 width = 112 Height = 25 caption = 'button1' taborder = 1 onclick = button1click end object button2: tbutton left = 239 Top = 39 width = 112 Height = 25 caption = 'button2' taborder = 2 onclick = button2click end object button3: tbutton left = 239 Top = 70 width = 112 Height = 25 caption = 'button3' taborder = 3 onclick = button3click end object button4: tbutton left = 239 Top = 101 width = 112 Height = 25 caption = 'button4' taborder = 4 onclick = button4click end object button5: tbutton left = 239 Top = 132 width = 112 Height = 25 caption = 'button5' taborder = 5 onclick = button5click end object button6: tbutton left = 239 Top = 163 width = 112 Height = 25 caption = 'button6' taborder = 6 onclick = button6click end object button7: tbutton left = 239 Top = 194 width = 112 Height = 25 caption = 'button7' taborder = 7 onclick = button7click end object dximagelist1: tdximagelist items. colortable = {0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000} items = left = 192 Top = 16 endend