| |
 |
SWAPI_GetCountryFlagsImageList
This function creates an image list that contains the flags of all countries that are included in the officially assigned 3166-1 code list. This function returns a handle to the created image list.
Syntax
| Microsoft Visual C++ |
| HIMAGELIST __stdcall SWAPI_GetCountryFlagsImageList(); |
|
| Borland Delphi |
| function SWAPI_GetCountryFlagsImageList: HIMAGELIST; stdcall; |
|
| Microsoft Visual Basic |
| Declare Function SWAPI_GetCountryFlagsImageList Lib "swapires.dll" () As Long |
|
Parameters
This function has no parameters.
Return Value
If the function succeeds, the return value is the handle to the created (or existing, see remarks) image list.
If the function fails, the return value is NULL.
Remarks
This function uses the ImageList_Create function with the ILC_COLORDDB and ILC_MASK flags as the flags parameter. To create an image list with different parameters, use the SWAPI_GetCountryFlagsImageListEx function.
You don't have to destroy the created images list, as it will be automatically destroyed on program exit. If you still need to destroy it for whatever reason (e.g. for freeing system resources or recreating it with different parameters using the SWAPI_GetCountryFlagsImageListEx function), you must use SWAPI_DestroyCountryFlagsImageList; don't use ImageList_Destroy.
All subsequent calls to this function (before you call SWAPI_DestroyCountryFlagsImageList) will return a handle to the previously created image list.
Sample Code
| Microsoft Visual C++ |
void DrawFlag(WORD CountryID, HDC DC, int X, int Y) { HIMAGELIST hFlags = SWAPI_GetCountryFlagsImageList(); ImageList_DrawEx(hFlags, SWAPI_GetCountryFlagsImageListIndex(CountryID), DC, X, Y, 0, 0, CLR_NONE, CLR_NONE, ILD_TRANSPARENT); } |
|
| Borland Delphi |
procedure DrawFlag(const CountryID: WORD; const DC: HDC; const X, Y: Integer); begin ImageList_DrawEx(SWAPI_GetCountryFlagsImageList, SWAPI_GetCountryFlagsImageListIndex(CountryID), DC, X, Y, 0, 0, CLR_NONE, CLR_NONE, ILD_TRANSPARENT); end; |
|
| Microsoft Visual Basic |
Sub DrawFlag(ByVal CountryID As Integer, ByVal DC As Long, ByVal x As Integer, ByVal y As Integer) ImageList_DrawEx SWAPI_GetCountryFlagsImageList(), SWAPI_GetCountryFlagsImageListIndex(CountryID), DC, x, y, 0, 0, CLR_NONE, CLR_NONE, ILD_TRANSPARENT End Sub |
|
Defined In
| Microsoft Visual C++ |
| SWAPIRes.h, SWAPIRes.cpp |
|
| Borland Delphi |
| SWAPIRes.pas |
|
| Microsoft Visual Basic |
| SWAPIRes.bas |
|
See Also
SWAPI_GetCountryFlagsImageListEx SWAPI_DestroyCountryFlagsImageList
Copyright © 2006-2008, TamoSoft
|