Delphix (13) of Delphi and DirectX: tpicturecollectionitem. drawrotate

Source: Internet
Author: User
In this example (the actual effect is quite smooth, and GIF only shows an action trend ):

Code File:
Unit unit1; interfaceuses windows, messages, sysutils, variants, classes, graphics, controls, forms, dialogs, dxdraws, stdctrls, dxclass, comctrls; Type tform1 = Class (tform) dxw1 draw1: tdxdraw; Metadata: tdximagelist; dxtimer1: tdxtimer; Procedure formcreate (Sender: tobject); procedure merge (Sender: tobject; lagcount: integer); end; var form1: tform1; implementation {$ R *. DFM} var picitem: lens; angle: Cardinal; Procedure lens (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, picitem. height, {size} 0, {palette} 0.5, 0.5, {rotation center: 0 .. 1} byte (angle); {rotation angle 0 .. 255} Inc (angle); dxdraw1.flip; 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: 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.