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;