Delphix (21) of Delphi and DirectX: Drawing command of tdirectdrawsurface

Source: Internet
Author: User
Tdirectdrawsurface. pokeline (); tdirectdrawsurface. pokelinepolar (); tdirectdrawsurface. pokebox (); tdirectdrawsurface. pokeblendpixel (); tdirectdrawsurface. pokecircle (); tdirectdrawsurface. pokeellipse (); tdirectdrawsurface. pokefilledellipse (); tdirectdrawsurface. pokewuline (); tdirectdrawsurface. pokevline (); tdirectdrawsurface. dorotate ();

  

These drawing commands must be executed between tdirectdrawsurface. Lock and tdirectdrawsurface. Unlock, which is not particularly useful.

There are also two read/write attributes: pixel and pixels. During painting, the former must be between lock and unlock, and the latter cannot be locked. This is not perfect.

This example is just an example of draw line. Run:


Code File:
Unit unit1; interfaceuses windows, messages, sysutils, variants, classes, graphics, controls, forms, dialogs, dxclass, dxdraws; Type tform1 = Class (tform) dxdraw1: tdxdraw; dxtimer1: tdxtimer; Procedure formcreate (Sender: tobject); Procedure dxtimer1timer (Sender: tobject; lagcount: integer); end; var form1: tform1; implementation {$ R *. DFM} procedure tform1.formcreate (Sender: tobject); begin dxdraw1.align: = alclient; dxtimer1.interval: = 50; end; procedure merge (Sender: tobject; lagcount: integer); var X1, Y1, x2, Y2: integer; CLR: tcolor; begin X1: = random (dxdraw1.surface. width); Y1: = random (dxdraw1.surface. height); X2: = random (dxdraw1.surface. width); Y2: = random (dxdraw1.surface. height); CLR: = random ($ ffffff); // dxdraw1.surface. fill (0); dxdraw1.surface. lock; dxdraw1.surface. pokeline (x1, Y1, X2, Y2, CLR); dxdraw1.surface. unlock; 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: 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.