| |
 |
SWAPI_GetCountryFlagBitmap
This function loads the specified country flag bitmap resource and returns the handle to the loaded bitmap.
Syntax
| Microsoft Visual C++ |
HBITMAP __stdcall SWAPI_GetCountryFlagBitmap( WORD CountryID ); |
|
| Borland Delphi |
function SWAPI_GetCountryFlagBitmap( const CountryID: WORD ): HBITMAP; stdcall; |
|
| Microsoft Visual Basic |
Declare Function SWAPI_GetCountryFlagBitmap Lib "swapires.dll" ( ByVal CountryID As Integer ) As HBITMAP |
|
Parameters
| CountryID |
| [in] Country ID retrieved by using the functions for obtaining the country ID. |
Return Value
If the function succeeds, the return value is a handle to the loaded bitmap.
If the function fails, the return value is NULL.
Remarks
If the country code of the given CountryID is not on the Officially Assigned list of ISO 3166-1 codes, the function will return a handle to the bitmap that depicts a white flag with a question sign in the center.
The application must call the DeleteObject function to delete each bitmap handle returned by this function.
Sample Code
| Microsoft Visual C++ |
void DrawFlag(WORD CountryID, HDC DC, int X, int Y) { HDC FlagDC; HBITMAP Bitmap, OldBitmap;
FlagDC = CreateCompatibleDC(DC); Bitmap = SWAPI_GetCountryFlagBitmap(CountryID); OldBitmap = (HBITMAP)SelectObject(FlagDC, Bitmap); BitBlt(DC, X, Y, 16, 16, FlagDC, 0, 0, SRCCOPY); SelectObject(FlagDC, OldBitmap); DeleteDC(FlagDC); DeleteObject(Bitmap); } |
|
| Borland Delphi |
procedure DrawFlag(const CountryID: WORD; const DC: HDC; const X, Y: Integer); var FlagDC: HDC; Bitmap, OldBitmap: HBITMAP; begin FlagDC := CreateCompatibleDC(DC); Bitmap := SWAPI_GetCountryFlagBitmap(CountryID); OldBitmap := SelectObject(FlagDC, Bitmap); BitBlt(DC, X, Y, 16, 16, FlagDC, 0, 0, SRCCOPY); SelectObject(FlagDC, OldBitmap); DeleteDC(FlagDC); DeleteObject(Bitmap); end; |
|
| Microsoft Visual Basic |
Sub DrawFlag(ByVal CountryID As Integer, ByVal DC As Long, ByVal x As Integer, ByVal y As Integer) Dim FlagDC As Long Dim Bitmap As Long Dim OldBitmap As Long
FlagDC = CreateCompatibleDC(DC) Bitmap = SWAPI_GetCountryFlagBitmap(CountryID) OldBitmap = SelectObject(FlagDC, Bitmap) BitBlt DC, x, y, 16, 16, FlagDC, 0, 0, SRCCOPY Call SelectObject(FlagDC, OldBitmap) DeleteDC FlagDC DeleteObject Bitmap End Sub |
|
Defined In
| Microsoft Visual C++ |
| SWAPIRes.h, SWAPIRes.cpp |
|
| Borland Delphi |
| SWAPIRes.pas |
|
| Microsoft Visual Basic |
| SWAPIRes.bas |
|
See Also
Functions for Obtaining the Country ID
Copyright © 2006-2008, TamoSoft
|