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

# TImageListHelper.DrawForControl

Draws an image scaled to the display density (PPI) for the specified control.

## Declaration

Source position: controls.pp line 397

`public procedure TImageListHelper.DrawForControl(`
`ACanvas: TCanvas;`
`AX: Integer;`
`AY: Integer;`
`AIndex: Integer;`
`AImageWidthAt96PPI: Integer;`
`AControl: TControl;`
`AEnabled: Boolean = True`
`); overload; procedure TImageListHelper.DrawForControl(`
`ACanvas: TCanvas;`
`AX: Integer;`
`AY: Integer;`
`AIndex: Integer;`
`AImageWidthAt96PPI: Integer;`
`AControl: TControl;`
`ADrawEffect: TGraphicsDrawEffect`
`); overload;`

## Arguments

`ACanvas` |  | Canvas where the image is drawn.
`AX` |  | Horizontal position on the canvas where the image is drawn.
`AY` |  | Vertical position on the canvas where the image is drawn.
`AIndex` |  | Ordinal position for the image drawn in the method.
`AImageWidthAt96PPI` |  | Image width using the standard display density.
`AControl` |  | Control with the display density (Font PPI) and canvas scaling factor used in the method.
`AEnabled` |  | Indicates the image is drawn in the enabled state when True.

## Arguments

`ACanvas` |  | Canvas where the image is drawn.
`AX` |  | Horizontal position on the canvas where the image is drawn.
`AY` |  | Vertical position on the canvas where the image is drawn.
`AIndex` |  | Ordinal position for the image drawn in the method.
`AImageWidthAt96PPI` |  | Image width using the standard display density.
`AControl` |  | Control with the display density (Font PPI) and canvas scaling factor used in the method.
`ADrawEffect` |  | Indicates the TGraphicsDrawEffect applied to the image.

## Description

DrawForControl is an overloaded procedure used to draw the specified image scaled to the display density (PPI) for the specified control. DrawForControl calls the DrawForPPI method in the image list to render the selected image using the display density and drawing effect required.

ACanvas contains the control canvas where the image is drawn. AX and AY contains the left and top coordinates on the canvas where the image is drawn.

AIndex specifies the ordinal position in the scaled image list for the image drawn in the method.

AImageWidthAt96PPI contains the width for the image at 96 PPI. The actual image width is scaled to the display density using scaling factor required for the control.

AControl contains the TControl instance that provides the display density and canvas scaling factor required for the image.

When AEnabled is True, the image is drawn using its Enabled state. Otherwise, it is rendered using the disabled state.

ADrawEffect contains the TGraphicsDrawEffect used when rendering the image to the control canvas.

## See also

TCustomImageList.DrawForPPI |  | Renders an image to a canvas scaled to a specified display density.