Sign in Join
FPDoc Onlineexperiment

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

AntiAliasedStretchDrawBitmapprocedureStretch-draws a bitmap using anti-aliased drawing.
BitmapGrayscaleprocedureConverts a bitmap to grayscale taking filtering parameters into account.
ColorAdjustLumafunction
ColorHLSToRGBfunction
ColorIsDarkfunction
ColorRGBToHLSprocedureConverts an RGB color value to Hue, Luminance, and Saturation values.
ColorToGrayfunctionConverts a Lazarus TColor value to its grayscale equivalent.
ColorToHLSprocedureConverts a TColor value to its Hue, Lightness, and Saturation values.
ColorToHSVprocedureConverts a TColor value to Hue, Saturation, and brightness Values.
ContrastColorfunction
DrawArrowprocedureDraws a line with an arrow at the specified location on a canvas.
DrawGradientWindowprocedureDraws a window with a Title using gradient coloring.
DrawRotatedTextprocedureDraws the provided text on the given canvas, rotated by an angle as specified by the canvas' Font.Orientation. Returns the smallest enclosing rectangle.
DrawVerticalGradientprocedureDraws a gradient from top to bottom with parabolic color variation.
GetHighLightColorfunction
GetHValuefunctionGets the Hue value from the specified TColor value.
GetShadowColorfunction
GetSValuefunctionGets the Saturation value from the specified TColor value.
GetVValuefunctionGets the brightness value from the specified TColor value.
HLStoColorfunctionConverts Hue, Lightness, and Saturation values to a TColor value.
HLStoRGBprocedureConverts Hue, Lightness, and Saturation values to a RGB color values.
HSVRangeToColorfunction
HSVToColorfunctionConverts Hue, Saturation, and brightness values to a TColor value.
HSVtoRGBprocedureConverts Hue, Saturation, and brightness values to RGB values.
HSVtoRGBQuadfunctionConverts Hue, Saturation, and brightness values to a TRGBQuad value .
HSVtoRGBRangeprocedure
HSVtoRGBTriplefunctionConverts Hue, Saturation, and brightness values to a TRGBTriple value .
NormalizeRectfunctionEnsures that coordinates in the rectangle are in the correct order.
RGBtoHLSprocedureConverts RGB color values to Hue, Lightness, and Saturation values.
RGBToHSVprocedureConverts RGB values to Hue, Saturation, and brightness values.
RGBtoHSVRangeprocedure
ScaleImgprocedureScales the specified bitmap image to the required dimensions.
WaveToprocedureDraws a horizontal or vertical wave at the specified position to the given device context.
WordWrapprocedureSplits the provided string AText at word boundaries to individual lines so that these lines, in pixels, are not longer than the given AMaxWidth.

Types

TArrowTypeenumerationIndicates the drawing style for an arrow.
TScrollDirectionenumerationEnumerated type that indicates the direction for scrollbar arrows.

Constants

NiceArrowAngleconstant

Uses

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.