Gdiplus [16]: setblendbellshape and setblendtriangularshape of igplineargradientbrush

Source: Internet
Author: User
Setblendbellshape: Create a gradient transition process based on the bell curve;

Setblendtriangularshape: Creates a linear gradient process that linearly transitions from the center color to a single color at both ends.

The two methods seem to have little difference.

Setblendbellshape test:


Setblendtriangularshape test:


Setblendbellshape TestCode:

Uses gdiplus; Procedure tform1.formpaint (Sender: tobject); var graphics: igpgraphics; rect: tgprectf; brush: igplineargradientbrush; begin graphics: = tgpgraphics. create (canvas. handle); rect. initialize (10, 10,120,150); brush: = tgplineargradientbrush. create (rect, $ ffff0000, $ ff0000ff, 0); brush. setblendbellshape (1); graphics. fillellipse (brush, rect); brush. set blendbellshape (0.8); graphics. translatetransform (rect. X + rect. width, 0); graphics. fillellipse (brush, rect); brush. set blendbellshape (0.5); graphics. translatetransform (rect. X + rect. width, 0); graphics. fillellipse (brush, rect); brush. set blendbellshape (0.2); graphics. translatetransform (rect. X + rect. width, 0); graphics. fillellipse (brush, rect); brush. setblendbellshape (0); graphics. translatetransform (rect. X + rect. width, 0); graphics. fillellipse (brush, rect); // graphics. translatetransform (-graphics. transform. offsetx, rect. Y + rect. height); brush. setblendbellshape (1, 1); graphics. fillellipse (brush, rect); brush. set blendbellshape (1, 0.8); graphics. translatetransform (rect. X + rect. width, 0); graphics. fillellipse (brush, rect); brush. set blendbellshape (1, 0.5); graphics. translatetransform (rect. X + rect. width, 0); graphics. fillellipse (brush, rect); brush. set blendbellshape (1, 0.2); graphics. translatetransform (rect. X + rect. width, 0); graphics. fillellipse (brush, rect); brush. setblendbellshape (1, 0); graphics. translatetransform (rect. X + rect. width, 0); graphics. fillellipse (brush, rect); end;
 
   
 

Setblendtriangularshape test code:

Uses gdiplus; Procedure tform1.formpaint (Sender: tobject); var graphics: igpgraphics; rect: tgprectf; brush: igplineargradientbrush; begin graphics: = tgpgraphics. create (canvas. handle); rect. initialize (10, 10,120,150); brush: = tgplineargradientbrush. create (rect, $ ffff0000, $ ff0000ff, 0); brush. setblendbellshape (1); graphics. fillellipse (brush, rect); brush. setblendtriangularshape (0.8); graphics. translatetransform (rect. X + rect. width, 0); graphics. fillellipse (brush, rect); brush. setblendtriangularshape (0.5); graphics. translatetransform (rect. X + rect. width, 0); graphics. fillellipse (brush, rect); brush. setblendtriangularshape (0.2); graphics. translatetransform (rect. X + rect. width, 0); graphics. fillellipse (brush, rect); brush. setblendtriangularshape (0); graphics. translatetransform (rect. X + rect. width, 0); graphics. fillellipse (brush, rect); // graphics. translatetransform (-graphics. transform. offsetx, rect. Y + rect. height); brush. setblendtriangularshape (1, 1); graphics. fillellipse (brush, rect); brush. setblendtriangularshape (1, 0.8); graphics. translatetransform (rect. X + rect. width, 0); graphics. fillellipse (brush, rect); brush. setblendtriangularshape (1, 0.5); graphics. translatetransform (rect. X + rect. width, 0); graphics. fillellipse (brush, rect); brush. setblendtriangularshape (1, 0.2); graphics. translatetransform (rect. X + rect. width, 0); graphics. fillellipse (brush, rect); brush. setblendtriangularshape (1, 0); graphics. translatetransform (rect. X + rect. width, 0); graphics. fillellipse (brush, rect); end;
 
  
 
Related Article

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.