Delphi GDI + Learning Records (5): Composite brushes

Source: Internet
Author: User

Composite brushes

var
 g: TGPGraphics;
 p: TGPPen;
 arr: array[0..9] of Single; {10 个元素可以分成 5 条线, 每条线需要起点和终点}
begin
 g := TGPGraphics.Create(Canvas.Handle);
 p := TGPPen.Create(MakeColor(255,255,0,0),100); {笔宽定为 100 好算帐}
 arr[0] := 0.00; {第一条线起点}
 arr[1] := 0.01; {第一条线终点}
 arr[2] := 0.10;
 arr[3] := 0.11;
 arr[4] := 0.20;
 arr[5] := 0.21;
 arr[6] := 0.30;
 arr[7] := 0.31;
 arr[8] := 0.40; {第五条线起点}
 arr[9] := 0.41; {第五条线终点}
 {数组参数是宽度的百分比, 必须 >=0、<=1}
 p.SetCompoundArray(@arr,Length(arr)); g.DrawLine(p, 11, 66, 333, 66);
 {这是画了一个五线谱}
 p.Free;
 g.Free;
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.