[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] Reference for unit 'Buttons' (#lcl)

TButtonGlyph.GetImageIndexAndEffect

Gets the index for a button image using a given state, and the effect used to draw it.

Declaration

Source position: buttons.pp line 120

public procedure TButtonGlyph.GetImageIndexAndEffect(

  State: TButtonState;

  APPI: Integer;

  const ACanvasScaleFactor: Double;

  out AImageResolution: TScaledImageListResolution;

  out AIndex: Integer;

  out AEffect: TGraphicsDrawEffect

);

Description

GetImageIndexAndEffect is a procedure used to get the ordinal position for the image used to render the Glyph for the class instance. In addition, it returns the image resolution for the specified display density and the drawing effect for the button State.

GetImageIndexAndEffect uses ThemeServiecs to determine if drawing effects are automatically applied to glyph images, and captures the effect in the AEffect output argument.

GetImageIndexAndEffect determines the image source and the ordinal position for the image used for the button glyph. ExternalImages and ExternalImageIndex are used (when assigned). The next available source is the resource name specified in LCLGlyphResourceName (when specified). Finally, the Images property is used (when assigned). When the image source has been determined, the correct image resolution for the value in APPI is selected and stored in AImageResolution. ImageIndexes is used to get the position for the image with the specified button State.

GetImageIndexAndEffect is used in in the implementation of the Draw method in TButtonGlyph, and in the GetGlyphSize method in TCustomSpeedButton.

See also

TButtonGlyph.ExternalImages

  

Contains a reference to an existing list of images available for use in the Glyph property.

TButtonGlyph.ExternalImageIndex

  

Ordinal position in the external image list for the glyph image.

TButtonGlyph.LCLGlyphName

  

Stores the standard LCL resource name used for the Glyph in the class instance.

TButtonGlyph.Images

  

The list of available images for the button glyph.

TButtonGlyph.Draw

  

Draws the glyph for the button using the specified settings.

TCustomSpeedButton.GetGlyphSize

  

GetGlyphSize - returns the size of the glyph within the specified PaintRect.

The latest version of this document can be found at lazarus-ccr.sourceforge.net.