Function Reference


_GUIImageList_DrawEx

Draws an image list item in the specified device context

#include <GuiImageList.au3>
_GUIImageList_DrawEx ( $hWnd, $iIndex, $hDC, $iX, $iY [, $iDX = 0 [, $iDY = 0 [, $iRGBBk = 0xFFFFFFFF [, $iRGBFg = 0xFFFFFFFF [, $iStyle = 0]]]]] )

Parameters

$hWnd Handle to the imagelist
$iIndex 0-based index of the image to draw
$hDC Handle to the destination device context
$iX X coordinate where the image will be drawn
$iY Y coordinate where the image will be drawn
$iDX [optional] The width of the portion of the image to draw relative to the upper-left corner of the image.
If $iDX and $iDY are zero, the function draws the entire image. The function does not ensure that the parameters are valid.
$iDY [optional] The height of the portion of the image to draw, relative to the upper-left corner of the image.
If $iDX and $iDY are zero, the function draws the entire image. The function does not ensure that the parameters are valid.
$iRGBBk [optional] The background color of the image. This parameter can be an application-defined RGB value or one of the following values:
    $CLR_NONE - No background color. The image is drawn transparently.
    $CLR_DEFAULT - The default background color. The image is drawn using the background color of the image list.
$iRGBFg [optional] The foreground color of the image. This parameter can be an application-defined RGB value or one of the following values:
    $CLR_NONE - No blend color. The image is blended with the color of the destination device context.
    $CLR_DEFAULT - The default foreground color. The image is drawn using the system highlight color as the foreground color.
$iStyle [optional] Drawing style and overlay image:
    1 - Draws the image transparently using the mask, regardless of the background color
    2 - Draws the image, blending 25 percent with the system highlight color
    4 - Draws the image, blending 50 percent with the system highlight color
    8 - Draws the mask

Return Value

Success: True.
Failure: False.

Related

_GUIImageList_Draw

Example

#include <GUIConstantsEx.au3>
#include <GuiImageList.au3>
#include <WinAPIGdi.au3>
#include <WinAPIGdiDC.au3>

Example()

Func Example()
        Local $hImage, $hGUI, $hDC

        $hGUI = GUICreate("ImageList DrawEx", 400, 300)
        GUISetState(@SW_SHOW)

        ; Load images
        $hImage = _GUIImageList_Create(32, 24)
        _GUIImageList_Add($hImage, _WinAPI_CreateSolidBitmap($hGUI, 0xFF0000, 32, 24))
        _GUIImageList_Add($hImage, _WinAPI_CreateSolidBitmap($hGUI, 0x00FF00, 32, 24))
        _GUIImageList_Add($hImage, _WinAPI_CreateSolidBitmap($hGUI, 0x0000FF, 32, 24))

        ; Draw images
        $hDC = _WinAPI_GetDC($hGUI)
        _GUIImageList_DrawEx($hImage, 0, $hDC, 4, 4)
        _GUIImageList_DrawEx($hImage, 1, $hDC, 40, 4)
        _GUIImageList_DrawEx($hImage, 2, $hDC, 76, 4)

        _WinAPI_ReleaseDC($hGUI, $hDC)

        ; Loop until the user exits.
        Do
        Until GUIGetMsg() = $GUI_EVENT_CLOSE
        GUIDelete()
EndFunc   ;==>Example