Sign in Join
FPDoc Onlineexperiment

Graphics unit

graphics.pp contains classes, types, and routines used to represent graphic images in a Lazarus Component Library ( LCL) application. The following classes are added to the registered class list used by the Run-time Library ( RTL):

  • TBitmap
  • TPixmap
  • TPortableNetworkGraphic
  • TPortableAnyMapGraphic (when not explicitly disabled)
  • TJpegImage (when not explicitly disabled)
  • TGIFImage (when not explicitly disabled)
  • TPicture
  • TFont
  • TPen
  • TBrush
  • TRegion

graphics.pp is part of the Lazarus Component Library ( LCL).

Classes and records

EGraphicExceptionclassBase exception type for an error in a graphic operation.
EInvalidGraphicclassEInvalidGraphic - exception handler for an invalid graphic.
EInvalidGraphicOperationclassEInvalidGraphicOperation - exception handler for invalid graphic operation.
TBitmapclassImplements a FCL-compatible reader/writer for a Bitmap image.
TBrushclassThe Brush to be used to Paint on the current Canvas.
TBrushHandleCacheclassTBrushHandleCache - resource cache for Brush Handles.
TCanvasclassImplements a drawing surface for a visual control or bitmap image.
TCursorImageclassTCursorImage - an Icon to be used to represent a cursor.
TCursorImageImageclassImplements the image for a cursor, stored as an Icon.
TCustomBitmapclassTCustomBitmap - the base class for TBitmap.
TCustomIconclassTCustomIcon - base class for TIcon.
TFontclassRepresents a font used to draw text in an application.
TFontDatarecordContains information about a font used in an application.
TFontHandleCacheclassTFontHandleCache - a resource cache for font handles.
TFontHandleCacheDescriptorclassTFontHandleCacheDescriptor - descriptor for items in Font Handle Cache.
TFPImageBitmapclassImplements a Bitmap using the FPImage reader and writer from the FCL.
TGIFImageclassImplements an image using the GIF (Graphics Interchange Format) image format.
TGraphicclassAbstract base class used for images in supported image formats.
TGraphicsObjectclassPrimitive ancestor class, mainly for Delphi compatibility.
TIcnsIconclassImplements a macOS Icon Resource file.
TIcnsListclassImplements a list used to maintain TIcnsIcon instances.
TIcnsRecrecordRecord type with the icon type and raw image data for a TIcnsIcon instance.
TIconclassImplements an icon image type; small images typically associated with applications, controls, etc.
TIconImageclassTIconImage - a primitive Icon class with handles for the Bitmap, Mask and Palette.
TJPEGImageclassTJPEGImage - a class for handling images stored in JPEG (compressed) format.
TLCLTextMetricrecordA record representing the physical dimensions of the currently selected font in the canvas.
TPenclassRepresents a pen used to draw on a canvas.
TPenHandleCacheclassTPenHandleCache - Resource Cache for Pen Handles.
TPenHandleCacheDescriptorclassCache descriptor for Pen Handles.
TPictureclassImplements a container for TGraphic and descendent classes.
TPixmapclassImplements support for the XPM (Pixmap) image format.
TPortableAnyMapGraphicclassImplements an image which supports for the Portable Any Map (PNM) graphic format.
TPortableNetworkGraphicclassImplements support for the PNG image format.
TRasterImageclassBase class for a number of graphic controls, including TCustomBitmap and TCustomIcon, which use a raster of dots to display graphic information.
TRegionclassA defined area on a screen or canvas used to render a graphic image or text output.
TRegionOperationrecordRepresents a region operation.
TSharedBitmapclassDefines a reference-counted shared Bitmap graphic.
TSharedCursorImageclassImplements a reference-counted shared image used for cursors.
TSharedCustomBitmapclassImplements the base class for a reference-counted shared image.
TSharedGIFImageclassImplements a reference-counted shared GIF image.
TSharedIcnsIconclassDeclares the shared icon for the TIcnsIcon type.
TSharedIconclassImplements a reference-counted shared Icon image type.
TSharedImageclassSpecifies the base class for reference-counted shared images.
TSharedJpegImageclassTSharedJpegImage - a reference counted shared image of type JPEG.
TSharedPixmapclassImplements a reference-counted shared Pixmap image type.
TSharedPortableAnyMapGraphicclassTSharedPortableAnyMapGraphic - a reference counted shared PNM.
TSharedPortableNetworkGraphicclassTSharedPortableNetworkGraphic - a reference counted PNG Image.
TSharedRasterImageclassImplements a reference counted raster image that may be shared between controls.
TSharedTiffImageclassDeclares the shared image for the TTiffImage type.
TTextStylerecordThe Style of the Text to be drawn in a rectangle.
TTiffImageclassImplements support for the TIFF (Tag Image File Format) graphic format.

Procedures and functions

AllocPatternBitmapfunctionEnsures that a Pattern Bitmap with the specified colors exists in the Pattern cache.
BluefunctionFinds the Blue component of the supplied color.
CharsetToIdentfunctionConverts the specified numeric character set identifier to its representation as a string.
ClearXLFDHeightfunctionReplaces the PixelSize, PointSize, ResolutionX, ResolutionY and AverageWidth segments in an XLFD font name with the '*' wildcard.
ClearXLFDItemfunctionReplaces the specified XLFD segment value with the '*' wildcard.
ClearXLFDPitchfunctionReplaces the spacing for a XLFD font descriptor format with a '*' wildcard.
ClearXLFDStylefunctionReplaces the WeightName, Slant and SetwidthName segments in an XLFD font name with the '*' wildcard.
ColorIndexfunctionFinds the position in the color identifier map for the specified value.
ColorToIdentfunctionColorToIdent - given a Color value, find its name ( Ident) in the look-up table of Colors.
ColorToRGBfunctionConverts a TColor value to an RGB color constant.
ColorToStringfunctionGets a string representation for the specified TColor value.
CreateBitmapFromFPImagefunctionCreates a Bitmap with the content from the specified TFPCustomImage instance.
CreateBitmapFromLazarusResourcefunctionCreates and loads a Bitmap from a Lazarus Resource (.lrs) file.
CreateBitmapFromResourceNamefunctionCreates a TCustomBitmap instance with the content for the named Lazarus resource.
CreateCompatibleBitmapsfunctionCreates a TLazIntfImage instance for the specified raw image data, and returns the handles to the image and optional mask information.
CreateGraphicFromResourceNamefunctionCreates and loads a TGraphic instance with the content from the specified resource instance handle and resource name.
DbgSfunctionCreates a formatted debugger message with values from the TFontStyles set.
DecColorfunctionDecreases the component RGB values in a color by the specified amount (results in a darker color overall).
ExtractFamilyFromXLFDNamefunctionGets the family name for the typeface used in the XLFD font descriptor.
ExtractXLFDItemfunctionGets the value for the specified segment in an XLFD font descriptor.
FontNameToPangoFontDescStrprocedureParses the specified font name into X Logical Font Descriptor attributes.
FPColorToTColorfunctionFPColorToTColor - converts a color specified as a FPColor to a color of type TColor.
FPColorToTColorReffunctionConverts a TFPColor value to a Cardinal color reference used in API system color constants.
GetCharsetValuesprocedureCalls the specified procedure for each of the character set names in FontCharsets.
GetColorValuesprocedureExecutes the specified procedure for each of the non-deprecated Color names defined for the platform.
GetDefFontCharSetfunctionGets the default TFontCharSet value for the platform.
GetFontDatafunctionGets font data for the specified font handle.
GetGraphicClassForFileExtensionfunctionGets the TGraphicClass instance used for images with the specified file extension.
GraphicExtensionfunctionGets a string with the file extension used for the specified graphic class type.
GraphicFileMaskfunctionGets one or more file masks which can be used to select image files for the specified TGraphicClass instance.
GraphicFilterfunctionGets a filter string for files using the specified graphic class type.
GreenfunctionFinds the Green component of the supplied color.
IdentEntryfunctionChecks whether a given Entry exists in a Map of color names.
IdentToCharsetfunctionConverts the specified character set identifier to the its numeric representation.
IdentToColorfunctionIdentToColor - given a color identifier (name) returns the color value.
IncColorfunctionIncreases the component RGB values in a color by the specified amount (results in a lighter color overall).
InvertColorfunctionInvertColor - returns the complementary color to the supplied value - helps to produce a 'negative' image.
IsFontNameXLogicalFontDescfunctionDetermines if the specified font name is a valid X Logical Font Description.
IsSysColorfunctionIndicates whether the specified color reference is one of the system colors.
LazResourceXPMToPPCharfunctionLoads an XPM image resource into an array.
LoadCursorFromLazarusResourcefunctionLoadCursorFromLazarusResource - loads a named cursor handle from the Lazarus Resource (.LRS).
ReadXPMFromStreamfunctionConverts an XPM image stored in the specified stream into an array of PChar values.
ReadXPMSizefunctionReads the first line from an XPM PChar array which contains the width, height and number of colors for the XPM data.
RedfunctionFinds the Red component of the supplied color.
RedGreenBlueprocedureRedGreenBlue - decomposes a composite color into its component Red, Green and Blue values.
RegisterprocedureRegisters TPersistent classes for use in the RTL.
RGBToColorfunctionCombines the values for Red, Green and Blue into a TColor value.
ScaleXfunctionResizes the specified horizontal size from a given display density to the current screen PPI.
ScaleYfunctionResizes the specified vertical size from a given display density to the current screen PPI.
StringToColorfunctionConverts the specified string representation for a color to a TColor value.
StringToColorDeffunctionConverts the specified string representation for a color to a TColor value using a specified default value.
SysColorToSysColorIndexfunctionSysColorToSysColorIndex - if Color is one of the system colors, returns the Index of the system color.
TColorToFPColorfunctionTColorToFPColor - converts a color of type TColor to one specified as a FPColor.
TestStreamIsBMPfunctionExamines values in the specified stream to determine if it contains a .BMP image.
TestStreamIsCursorfunctionExamines values in the specified stream to determine if it contains a .CUR cursor image.
TestStreamIsIconfunctionExamines values in the specified stream to determine if it contains a .ICO image.
TestStreamIsXPMfunctionExamines values in the specified stream to determine if it contains a .XPM image.
UpdateHandleObjectsprocedureRenews handles for Fonts, Pens, and Brushes.
XLFDHeightIsSetfunctionChecks whether an explicit value is assigned to XLFD segments controlling font height.
XLFDNameToLogFontfunctionGets a logical font record with values representing the specified XLFD font descriptor.
XPMToPPCharfunctionConverts an XPM image file into an array of PChar values.

Types

PColortypePointer to the TColor type.
PIcnsRectypePointer to a TIcnsRec instance.
TAntialiasingModeenumerationRepresents anti-aliasing modes used in TCanvas.
TBitmapHandleTypeenumerationRepresents handle types used for Bitmaps.
TBrushStyletypeRepresents the pattern for a Brush.
TCanvasOrientationenumerationRepresents orientations for a canvas.
TCanvasStatesetSet type used to store TCanvasStates values.
TCanvasStatesenumerationRepresents states values for TCanvas.
TColortypeColor type used by most LCL drawing functions.
TCopymodetypeType used to represent canvas copy modes.
TCustomBitmapClasstypeClass reference used to create new instances of TCustomBitmap.
TDefaultColorTypeenumerationIndicates whether a default color applies to a font or a brush.
TFillModeenumerationRepresents Fill Mode values.
TFillStyletypeAlias for the TGraphicsFillStyle enumeration type in LazUtils.
TFontCharSettypeRepresents a font character set as a numeric value.
TFontDataNametypeShort String type used for typeface names.
TFontNametypeAlias to the String type used to represent font names.
TFontPitchenumerationRepresents pitches (or spacings) used in typefaces.
TFontQualityenumerationFont output quality, like anti-aliasing.
TFontStyleenumerationRepresents styles or variants for a font.
TFontStylessetSet type used to store TFontStyle value(s).
TFontStylesbasesetSet type used to store TFontStyle value(s).
TFPImageBitmapClasstypeClass reference used to create new instances of TFPImageBitmap.
TGetColorStringProcprocedure typeSpecifies an object procedure used to process color value to color identifier map entries.
TGradientDirectionenumerationRepresents the fill directions used for gradient fills.
TGraphicClasstypeTGraphicClass - class of TGraphic.
TIconImageClasstypeClass reference used to create new instances of TIconImage.
TJPEGPerformancetypeRepresents JPEG read performance setting values.
TJPEGQualityRangetypeRepresents JPEG compression quality values.
TOnGetSystemFontprocedure typeSpecifies a function type which returns a HFONT handle for a system font.
TOnLoadGraphicFromClipboardFormatprocedure typeSpecifies a procedure type used to load a graphic image from a clipboard format.
TOnSaveGraphicToClipboardFormatprocedure typeSpecifies a procedure type used to save a graphic image to a clipboard format.
TPenEndCaptypeRepresents end cap styles used for a pen.
TPenJoinStyletypeRepresents join styles used between line segments.
TPenModetypeRepresents pen modes used when rendering to a canvas.
TPenPatterntypeRepresents a pattern brush for a pen.
TPenStyletypeRepresents line drawing styles used when rendering to a canvas.
TPixelFormatenumerationRepresents storage formats for pixels in image data.
TProgressEventtypeSpecifies an event handler for monitoring the progress of a drawing process.
TProgressStagetypeAlias for the TFPImgProgressStage type in the FCL.
TRasterImageClasstypeClass reference used to create new instances of TRasterImage.
TRegionCombineModeenumerationRepresents combination methods used for regions.
TRegionOperationstypeArray type used to store TRegionOpertation elements.
TRegionOperationTypeenumerationRepresents Region operators used in TRegionOperation.
TSharedRasterImageClasstypeTSharedRasterImageClass - class of TSharedRasterImage.
TTextLayoutenumerationRepresents the text layout used to render text in its rectangle.
TTiffUnitenumerationRepresents units of measure used in TIFF image data.
TTransparentModeenumerationRepresents transparency modes used in raster images.

Constants

bsBDiagonalconstantRepresents the BDiagonal brush style.
bsClearconstantRepresents the Clear brush style.
bsCrossconstantRepresents the Cross brush style.
bsDiagCrossconstantRepresents the DiagCross brush style.
bsFDiagonalconstantRepresents the FDiagonal brush style.
bsHorizontalconstantRepresents the Horizontal brush style.
bsImageconstantRepresents the user-specified Image (bitmap) brush style.
bsPatternconstantRepresents the user-specified Pattern (bitmap) brush style.
bsSolidconstantRepresents the Solid brush style.
bsVerticalconstantRepresents the Vertical brush style.
cl3DDkShadowconstantOne of the System colors.
cl3DFaceconstantA synonym not displayed in color lists.
cl3DHiLightconstantA synonym not displayed in color lists.
cl3DLightconstantOne of the System colors.
cl3DShadowconstantA synonym not displayed in color lists.
clActiveBorderconstantOne of the System colors.
clActiveCaptionconstantOne of the System colors.
clAppWorkspaceconstantOne of the System colors.
clAquaconstantOne of the standard colors. Delphi compatible.
clBackgroundconstantOne of the System colors.
clBlackconstantOne of the standard colors. Delphi compatible.
clBlueconstantOne of the standard colors. Delphi compatible.
clBtnFaceconstantColor for a button face.
clBtnHighlightconstantOne of the System colors.
clBtnHiLightconstantA synonym not displayed in color lists.
clBtnShadowconstantOne of the System colors.
clBtnTextconstantThe color for the text or other raised area on a button.
clCaptionTextconstantOne of the System colors.
clColorDesktopconstantA synonym not displayed in color lists.
clCreamconstantOne of the extended colors.
clDefaultconstantThe default color of a given control.
clDkGrayconstantOne of the standard colors. Delphi compatible.
clDontMaskconstantAlias for the clBlack constant.
clFirstSpecialColorconstantAlias for the clBtnHiLight constant.
clFormconstantRepresents the color of the background for a form.
clFuchsiaconstantOne of the standard colors. Delphi compatible.
clGradientActiveCaptionconstantOne of the System colors.
clGradientInactiveCaptionconstantOne of the System colors.
clGrayconstantOne of the standard colors. Delphi compatible.
clGrayTextconstantOne of the System colors.
clGreenconstantOne of the standard colors. Delphi compatible.
clHighlightconstantOne of the System colors.
clHighlightTextconstantOne of the System colors.
clHotLightconstantOne of the System colors.
clInactiveBorderconstantOne of the System colors.
clInactiveCaptionconstantOne of the System colors.
clInactiveCaptionTextconstantOne of the System colors.
clInfoBkconstantOne of the System colors.
clInfoTextconstantOne of the System colors.
clLimeconstantOne of the standard colors. Delphi compatible.
clLtGrayconstantOne of the standard colors. Delphi compatible.
clMaroonconstantOne of the standard colors. Delphi compatible.
clMaskconstantAlias for the clWhite constant.
clMedGrayconstantOne of the extended colors.
clMenuconstantOne of the System colors.
clMenuBarconstantOne of the System colors used for the menu bar.
clMenuHighlightconstantOne of the System colors used for highlights on a menu.
clMenuTextconstantThe color of the text in menus.
clMoneyGreenconstantOne of the extended colors.
clNavyconstantOne of the standard colors. Delphi compatible.
clNoneconstantOne of the special colors.
clOliveconstantOne of the standard colors. Delphi compatible.
clPurpleconstantOne of the standard colors. Delphi compatible.
clRedconstantOne of the standard colors. Delphi compatible.
clScrollBarconstantOne of the System colors.
clSilverconstantOne of the standard colors. Delphi compatible.
clSkyBlueconstantOne of the extended colors.
clTealconstantOne of the standard colors. Delphi compatible.
clWhiteconstantOne of the standard colors. Delphi compatible.
clWindowconstantBackground color for an edit control.
clWindowFrameconstantOne of the System colors.
clWindowTextconstantThe color for the text in an edit control.
clYellowconstantOne of the standard colors. Delphi compatible.
cmBlacknessconstantTernary raster operation (Dst op Src op Pattern): Fills the destination area with all black.
cmDstInvertconstantTernary raster operation (Dst op Src op Pattern): Fills the destination area with (not Dst).
cmMergeCopyconstantTernary raster operation (Dst op Src op Pattern): Fills the destination area with (Src and Pattern).
cmMergePaintconstantTernary raster operation (Dst op Src op Pattern): Fills the destination area with (Dst or not Src).
cmNotSrcCopyconstantTernary raster operation (Dst op Src op Pattern): Fills the destination area with (not Src).
cmNotSrcEraseconstantTernary raster operation (Dst op Src op Pattern): Fills the destination area with (not (Dst or Src)).
cmPatCopyconstantTernary raster operation (Dst op Src op Pattern): Fills the destination area with (Pattern).
cmPatInvertconstantTernary raster operation (Dst op Src op Pattern): Fills the destination area with (Dst xor Pattern).
cmPatPaintconstantTernary raster operation (Dst op Src op Pattern): Fills the destination area with (Dst or (not Src) or Pattern).
cmSrcAndconstantTernary raster operation (Dst op Src op Pattern): Fills the destination area with (Dst and Src).
cmSrcCopyconstantTernary raster operation (Dst op Src op Pattern): Fills the destination area with Src.
cmSrcEraseconstantTernary raster operation (Dst op Src op Pattern): Fills the destination area with ((not Dst) and Src).
cmSrcInvertconstantTernary raster operation (Dst op Src op Pattern): Fills the destination area with (Dst xor Src).
cmSrcPaintconstantTernary raster operation (Dst op Src op Pattern): Fills the destination area with (Dst or Src).
cmWhitenessconstantTernary raster operation (Dst op Src op Pattern): Fills the destination area with all white.
DefFontDataconstantDefault font data used for new TFont instances.
ExtendedColorCountconstantThe number of defined extended color constants.
FontCharsetsconstantArray constant with TIdentMapEntry values for character sets in TFont instances.
pecFlatconstantRepresents the Flat pen end cap.
pecRoundconstantRepresents the Round pen end cap.
pecSquareconstantRepresents the Square pen end cap.
PIXELFORMAT_BPPconstantConstant with the number of bits per pixel for TPixelFormat enumeration values.
pjsBevelconstantRepresents the Bevel pen join style.
pjsMiterconstantRepresents the Miter pen join style.
pjsRoundconstantRepresents the Round pen join style.
pmBlackconstantRepresents the Black pen mode.
pmCopyconstantRepresents the Copy pen mode.
pmMaskconstantRepresents the Mask pen mode.
pmMaskNotPenconstantRepresents the Mask Not Pen pen mode.
pmMaskPenNotconstantRepresents the Mask Pen Not pen mode.
pmMergeconstantRepresents the Merge pen mode.
pmMergeNotPenconstantRepresents the Merge Not Pen pen mode.
pmMergePenNotconstantRepresents the Merge Pen Not pen mode.
pmNopconstantRepresents the No OP pen mode.
pmNotconstantRepresents the NOT pen mode.
pmNotCopyconstantRepresents the Not Copy pen mode.
pmNotMaskconstantRepresents the Not Mask pen mode.
pmNotMergeconstantRepresents the Not Merge pen mode.
pmNotXorconstantRepresents the Not XOR pen mode.
pmWhiteconstantRepresents the White pen mode.
pmXorconstantRepresents the XOR pen mode.
psClearconstantRepresents the clear pen style.
psDashconstantRepresents the dashed pen style.
psDashDotconstantRepresents the dash-dot pattern pen style.
psDashDotDotconstantRepresents the dash-dot-dot pattern pen style.
psDotconstantRepresents the dotted pen style.
psInsideframeconstantRepresents the pen style used for an inside frame.
psPatternconstantRepresents a pattern pen style.
psSolidconstantRepresents the solid pen style.
StandardColorsCountconstantNumber of defined standard color constants.

Variables

BrushResourceCachevariableVariable used as the cache for Brush resources.
FontResourceCachevariableVariable used as the cache for Font resources.
OnGetSystemFontvariableAddress of the routine used to get the handle for the system font.
OnLoadGraphicFromClipboardFormatvariableAddress of the routine used to load a graphic from a clipboard format.
OnLoadSaveClipBrdGraphicValidvariableIndicates whether clipboard formats for graphic types have been registered for the application.
OnSaveGraphicToClipboardFormatvariableAddress of the routine used to save a graphic to a clipboard format.
PenResourceCachevariableVariable used as the cache for Pen resources.
ScreenInfovariableContains display attributes for the current screen in an application.

Uses

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