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

# TCustomImageListResolution.Draw

Renders an image to the specified canvas.

## Declaration

Source position: imglist.pp line 161

`public procedure TCustomImageListResolution.Draw(`
`ACanvas: TCanvas;`
`AX: Integer;`
`AY: Integer;`
`AIndex: Integer;`
`AEnabled: Boolean = True`
`); overload; procedure TCustomImageListResolution.Draw(`
`ACanvas: TCanvas;`
`AX: Integer;`
`AY: Integer;`
`AIndex: Integer;`
`ADrawEffect: TGraphicsDrawEffect`
`); overload; procedure TCustomImageListResolution.Draw(`
`ACanvas: TCanvas;`
`AX: Integer;`
`AY: Integer;`
`AIndex: Integer;`
`ADrawingStyle: TDrawingStyle;`
`AImageType: TImageType;`
`AEnabled: Boolean = True`
`); overload; procedure TCustomImageListResolution.Draw(`
`ACanvas: TCanvas;`
`AX: Integer;`
`AY: Integer;`
`AIndex: Integer;`
`ADrawingStyle: TDrawingStyle;`
`AImageType: TImageType;`
`ADrawEffect: TGraphicsDrawEffect`
`); virtual; overload;`

## Arguments

`ACanvas` |  | Canvas where the image is drawn.
`AX` |  | Horizontal offset for the image on the canvas.
`AY` |  | Vertical offset for the image on the canvas.
`AIndex` |  | Position of the image drawn in the method.
`AEnabled` |  | Indicates if the image is drawn in an Enabled state.

## Arguments

`ACanvas` |  | Canvas where the image is drawn.
`AX` |  | Horizontal offset for the image on the canvas.
`AY` |  | Vertical offset for the image on the canvas.
`AIndex` |  | Position of the image drawn in the method.
`ADrawEffect` |  | Drawing effect applied to the rendered image.

## Arguments

`ACanvas` |  | Canvas where the image is drawn.
`AX` |  | Horizontal offset for the image on the canvas.
`AY` |  | Vertical offset for the image on the canvas.
`AIndex` |  | Position of the image drawn in the method.
`ADrawingStyle` |  | Drawing style applied to the rendered image.
`AImageType` |  | Indicates if the image contains a mask or source data.
`AEnabled` |  | Indicates if the image is drawn in an Enabled state.

## Arguments

`ACanvas` |  | Canvas where the image is drawn.
`AX` |  | Horizontal offset for the image on the canvas.
`AY` |  | Vertical offset for the image on the canvas.
`AIndex` |  | Position of the image drawn in the method.
`ADrawingStyle` |  | Drawing style applied to the rendered image.
`AImageType` |  | Indicates if the image contains a mask or source data.
`ADrawEffect` |  | Drawing effect applied to the rendered image.

## Description

Draw is an overloaded method used to render an image to the specified canvas. Overloaded variants allow the use of a drawing effect or style for the rendered image.

ACanvas contains the TCanvas instance used to render the requested image.

AX and AY contain Integer values representing the horizontal and vertical offsets from the canvas origin where the image is drawn.

AIndex contains the ordinal position for the requested image in the resolution.

AEnabled indicates if the image is drawn in the enabled state. When AEnabled is False, the gdeDisabled drawing effect is used to render the image to the canvas.

ADrawEffect is a value from the TGraphicsDrawEffect enumeration that indicates the drawing effect applied to the raw image data, and stored in the bitmap. Values in AEffect determine whether the image is rendered normally, as a disabled (or grayed) image, highlighted, shadowed, or as a monochrome bitmap mask.

ADrawingStyle contains a value from the TDrawingStyle enumeration that indicates the image list drawing style used for the rendered image. ADrawingStyle determines how the image is blended with its background color when a mask is used in the image. It has no significance when a mask is not present in the image.

AImageType contains a value from the TImageType enumeration, and indicates whether the image uses a mask.

The Draw method requires a valid TWSCustomImageListReference class instance to access the handle for its image list. The widgetset class is used to call its Draw method using the specified parameter values as arguments. The values in the BkColor and BlendColor properties for the ImageList are also passed in the arguments to the widgetset class.

No actions are performed in the method when AIndex contains a value that is an invalid position for the images in the resolution.