Copyright ©
Kambiz R. Khojasteh. All rights reserved.
Get future component updates from http://www.delphiarea.com.
Delphi
3 |
Delphi
4 |
Delphi
5 |
Delphi
6 |
Delphi
7 |
DESCRIPTION
TGradient is
an extremely fast gradient fill control with a large set of styles. As built-in,
TGradient can draw gradient in 23 styles and provides an easily method to
define custom styles. In addition, this control can shift and/or rotate the
gradient colors, which could be used for creating animated gradients.
PROPERTIES
- ColorBegin:
TColor
Determines the initial color of the gradient.
- ColorEnd:
TColor
Determines the final color of the gradient.
- Reverse:
Boolean
If set to true, logically reverses the value of ColorBegin and
ColorEnd properties.
- Rotation:
TGradientRotation
TGradientRotation = -100..100
Determines the amount of rotation (in percent) of the gradient colors.
When value of this property is positive, direction of rotation is from ColorBegin
toward ColorEnd, and for negative values vice versa.
- Shift: TGradientShift
TGradientShift = -100..100
Determines
the amount of shift (in percent) of the gradient colors. For positive values
ColorBegin shifts toward ColorEnd, and for negative values vice
versa.
- Style: TGradientStyle
TGradientStyle = (gsCustom, gsRadialC, gsRadialT, gsRadialB, gsRadialL, gsRadialR,
gsRadialTL, gsRadialTR, gsRadialBL, gsRadialBR, gsLinearH, gsLinearV, gsReflectedH,
gsReflectedV, gsDiagonalLF, gsDiagonalLB, gsDiagonalRF, gsDiagonalRB, gsArrowL,
gsArrowR, gsArrowU, gsArrowD, gsDiamond, gsButterfly)
Determines how the control fills the client area.
gsCustom |
|
When style
property is set to this value, the control firs OnCustom to get
the gradient pattern. |
gsRadialC |
|
Radial
- Central |
gsRadialT |
|
Radial
- Top |
gsRadialB |
|
Radial
- Bottom |
gsRadialL |
|
Radial
- Left |
gsRadialR |
|
Radial
- Right |
gsRadialTL |
|
Radial
- Top Left Corner |
gsRadialTR |
|
Radial
- Top Right Corner |
gsRadialBL |
|
Radial
- Bottom Left Corner |
gsRadialBR |
|
Radial
- Bottom Right Corner |
gsLinearH |
|
Linear
- Horizontal |
gsLinearV |
|
Linear
- Vertical |
gsReflectedH |
|
Reflected
- Horizontal |
gsReflectedV |
|
Reflected
- Vertical |
gsDiagonalLF |
|
Diagonal
- Linear - Forward |
gsDiagonalLB |
|
Diagonal
- Linear - Backward |
gsDiagonalRF |
|
Diagonal
- Reflected - Forward |
gsDiagonalRB |
|
Diagonal
- Reflected - Backward |
gsArrowL |
|
Arrow
- Left |
gsArrowR |
|
Arrow
- Right |
gsArrowU |
|
Arrow
- U |
gsArrowD |
|
Arrow
- Down |
gsDiamond |
|
Diamond |
gsButterfly |
|
Butterfly |
- UseSysColors:
Boolean
Determines where the control looks for the gradient colors.
KEY METHODS
- procedure
BeginUpdate
Suspends screen repainting.
- procedure
EndUpdate
Re-enables screen repainting.
- procedure
InvalidatePattern
Force the control to regenerate the gradient pattern. This method is useful
when you are using custom gradient and want to change the pattern to a new
one without changing the other properties of the control.
- function
CopyPatternTo(Bitmap: TBitmap): Boolean
Copies the gradient pattern in to the specified bitmap. If the pattern is
not available, the function returns False.
KEY EVENTS
- OnCustom:
TCustomGradientEvent
TCustomGradientEvent = procedure(Sender: TObject; const Colors: TGradientColors;
Pattern: TBitmap) of object
TGradientColors = array[0..255] of TRGBTriple
When Style property is set to gsCustom, control generates
this event to get the gradient pattern. Colors parameter is an array
of array of gradient colors, and pattern is a 24bit-format bitmap. In this
event, your code should define the dimensions of the pattern and set color
of its pixels (for more information, please refer to the components demo).
HISTORY
- 2.521 (June
18, 2004)
- The compiler error on Delphi 3 fixed.
2.52
(June 17, 2004)
- The new property UseSysColors added (Thanks to Peter
Schrooders).
- The new method CopyPatternTo added.
- 2.51 (August
15, 2003)
- The code of radial gradient styles were optimized (Thanks to Wolfgang
Kiwus).
- 2.5 (February
3, 2001)
- In this version, the drawing speed increased again.
- Some new gradient styles added.
- Now, the control supports custom gradient style, and as the result, the
event OnCustom added.
- Shifting and Rotating operations of the gradient colors and the related
properties Shift and Rotation added.
- New methods BeginUpdate, EndUpdate, and InvalidatePattern
added.
- The control does not support 16bit platform anymore.
- 2.0 (December
29, 2001)
- The drawing speed increased dramatically.
- New gradient fill styles added and the name of older styles changed.
- 1.0 (September
8, 2000)
- Initial release.
LICENSE
TGradient component
is freeware. You may copy component's files AS LONG AS YOU COPY ALL OF THEM.
If you want to change the source code in order to improve the component's
features, performance, etc. please send me the new source code so that I can
have a look at it. The changed source code should contain descriptions what
you have changed, and of course your name. The only thing you MAY NOT CHANGE
is the ORIGINAL COPYRIGHT INFORMATION.
DISCLAIMER
TGradient is
provided "AS IS" without any warranty of any kind, either express
or implied. The entire risk as to the quality and performance of the software
is with you. The author is NOT liable for any DAMAGES resulting from the use
and misuse of the component, especially he is NOT liable for DAMAGES that
were caused BY ANY VERSION WHICH HAS NOT BEEN PROGRAMMED BY THE AUTHOR HIMSELF.