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

TCustomImage.CalculatePreferredSize

Gets the preferred width and height used as the default size for the control.

Declaration

Source position: extctrls.pp line 566

protected procedure TCustomImage.CalculatePreferredSize(

  var PreferredWidth: Integer;

  var PreferredHeight: Integer;

  WithThemeSpace: Boolean

); override;

Arguments

PreferredWidth

  

Preferred width for the control instance.

PreferredHeight

  

Preferred height for the control instance.

WithThemeSpace

  

Indicates if additional space is reserved for theme element details. Not used in TCustomImage.

Description

CalculatePreferredSize is an overridden method in TCustomImage. It calculates the preferred width and height for the control, which is used by the LCL auto-sizing algorithms as the default size. In TCustomImage, the values in the PreferredWidth and PreferredHeight arguments are set to the Width and Height used in the Picture property. The WithThemeSpace argument is not used in the method.

CalculatePreferredSize does not call the inherited method.

See also

TCustomImage.Picture

  

Contains the image displayed in the control.

TPicture

  

Implements a container for TGraphic and descendent classes.

TControl.CalculatePreferredSize

  

Override this method to return the preferred height and width for the control.


Version 4.0 Generated 2025-05-03 Home