Method function IGDIPlus.IGPLinearGradientBrush.SetBlendTriangularShape(Single;Single) : TGPLinearGradientBrush
This is a Beta Read Only version of this page. Please review and send recommendations to mitov@mitov.com. We will enable the editing as soon as we are happy with the overall Wiki site.
Class: IGPLinearGradientBrush
Contents |
Syntax
Delphi:
function SetBlendTriangularShape( focus : Single, scale : Single ) : TGPLinearGradientBrush;
C++ Builder:
TGPLinearGradientBrush __fastcall SetBlendTriangularShape( float focus, float scale );
Visual C++ (MFC):
SetBlendTriangularShape( focus, scale );
Summary
Sets the blend shape of this linear gradient brush to create a custom blend based on a triangular shape.
Description
Call this method to set the blend shape of this linear gradient brush to create a custom blend based on a triangular shape.
Remarks
By default, the color changes gradually from the starting
color (color at the starting boundary of the linear gradient
brush) to the ending color (color at the ending boundary of
the linear gradient brush) as you move from the starting
boundary to the ending boundary. You can customize the
positioning and blending of the starting and ending colors by
using the TGPLinearGradientBrush.SetBlendTriangularShape
method.
The TGPLinearGradientBrush.SetBlendTriangularShape method customizes the blend so that it follows a triangular shape with the extremes of the triangle's base at the gradient's boundaries. The starting color, which, in a default blend, is at the starting boundary of a linear gradient brush, appears at the starting and ending boundaries of the linear gradient brush when a triangular-shaped blend is applied. The position of the ending color, which, in a default blend, is at the ending boundary, is somewhere between the boundaries and is determined by the value of the focus. In other words, the focus specifies the position of the peak of the triangle. For example, a focus value of 0.5 places the peak half way between the starting and ending boundaries. The ending color appears at this peak.
The ending color in a triangular-shaped blend is a percentage of the gamut between the gradient's default-blend starting color and default-blend ending color. For example, suppose a linear gradient brush is constructed with red as the starting color and blue as the ending color. If TGPLinearGradientBrush.SetBlendTriangularShape is called with a scale value of 0.3, the ending color in the triangular-shaped blend is a hue that is 30 percent between red and blue (70 percent red, 30 percent blue). A scale value of 1.0 produces an ending color that is 100 percent blue.