GraphUtil unit
Contains routines and types used when drawing graphics.
graphutil.pp contains routines and types used when drawing
graphics. They focus primarily on converting colors and drawing gradients,
scroll bars, and arrows.
It includes routines used to convert between both the HSL (hue, saturation, lightness) and HSV (hue, saturation, brightness value) alternative representations of the RGB color model.
HSV models the way different colors mix together, with the saturation dimension resembling various tints of brightly colored paint, and the value dimension resembling the mixture of those paints with varying amounts of black or white paint.
HSL places saturated colors around a circle with a lightness value of 0.5, where a lightness value of 0 or 1 is fully black or white (respectively).
GraphUtil is used in the Lazarus IDE, in LCL WidgetSet components, and optional Lazarus components like FPReport, SynEdit, and TAChart.
graphutil.pp is part of the Lazarus Component Library
(
LCL).
Procedures and functions
AntiAliasedStretchDrawBitmap | procedure | Stretch-draws a bitmap using anti-aliased drawing. |
BitmapGrayscale | procedure | Converts a bitmap to grayscale taking filtering parameters into account. |
ColorAdjustLuma | function | |
ColorHLSToRGB | function | |
ColorIsDark | function | |
ColorRGBToHLS | procedure | Converts an RGB color value to Hue, Luminance, and Saturation values. |
ColorToGray | function | Converts a Lazarus TColor value to its grayscale equivalent. |
ColorToHLS | procedure | Converts a TColor value to its Hue, Lightness, and Saturation values. |
ColorToHSV | procedure | Converts a TColor value to Hue, Saturation, and brightness Values. |
ContrastColor | function | |
DrawArrow | procedure | Draws a line with an arrow at the specified location on a canvas. |
DrawGradientWindow | procedure | Draws a window with a Title using gradient coloring. |
DrawRotatedText | procedure | Draws the provided text on the given canvas, rotated by an angle as specified by the canvas' Font.Orientation. Returns the smallest enclosing rectangle. |
DrawVerticalGradient | procedure | Draws a gradient from top to bottom with parabolic color variation. |
GetHighLightColor | function | |
GetHValue | function | Gets the Hue value from the specified TColor value. |
GetShadowColor | function | |
GetSValue | function | Gets the Saturation value from the specified TColor value. |
GetVValue | function | Gets the brightness value from the specified TColor value. |
HLStoColor | function | Converts Hue, Lightness, and Saturation values to a TColor value. |
HLStoRGB | procedure | Converts Hue, Lightness, and Saturation values to a RGB color values. |
HSVRangeToColor | function | |
HSVToColor | function | Converts Hue, Saturation, and brightness values to a TColor value. |
HSVtoRGB | procedure | Converts Hue, Saturation, and brightness values to RGB values. |
HSVtoRGBQuad | function | Converts Hue, Saturation, and brightness values to a TRGBQuad value . |
HSVtoRGBRange | procedure | |
HSVtoRGBTriple | function | Converts Hue, Saturation, and brightness values to a TRGBTriple value . |
NormalizeRect | function | Ensures that coordinates in the rectangle are in the correct order. |
RGBtoHLS | procedure | Converts RGB color values to Hue, Lightness, and Saturation values. |
RGBToHSV | procedure | Converts RGB values to Hue, Saturation, and brightness values. |
RGBtoHSVRange | procedure | |
ScaleImg | procedure | Scales the specified bitmap image to the required dimensions. |
WaveTo | procedure | Draws a horizontal or vertical wave at the specified position to the given device context. |
WordWrap | procedure | Splits the provided string AText at word boundaries to individual lines so that these lines, in pixels, are not longer than the given AMaxWidth. |
Types
TArrowType | enumeration | Indicates the drawing style for an arrow. |
TScrollDirection | enumeration | Enumerated type that indicates the direction for scrollbar arrows. |
Constants
NiceArrowAngle | constant |
Uses
An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.
