Icon operations
[GDI functions]

Defines

Functions


Define Documentation

#define CreateIcon ( hdc,
w,
h,
AndBits,
XorBits,
colornum   )     CreateIconEx(hdc, w, h, AndBits, XorBits, colornum, NULL)
See also:
CreateIconEx

Definition at line 5038 of file gdi.h.


Function Documentation

HICON GUIAPI CreateIconEx ( HDC  hdc,
int  w,
int  h,
const BYTE AndBits,
const BYTE XorBits,
int  colornum,
const RGB pal 
)

Creates an icon object from the memory.

This function creates an icon from memory data rather than icon file. w and h are the width and the height of the icon respectively. pANDBits and pXORBits are AND bitmask and XOR bitmask of the icon. MiniGUI currently support mono-color cursor 256-color icon and 16-color icon, colornum specifies the cursor's color depth. For mono-color, it should be 1, and for 16-color cursor, it should be 4.

Parameters:
hdc The device context.
w The width of the icon.
h The height of the icon.
AndBits The pointer to the AND bits of the icon.
XorBits The pointer to the XOR bits of the icon.
colornum The bit-per-pixel of XOR bits.
pal The palette of icon.
Returns:
The handle to the icon object, zero means error occurred.
See also:
LoadIconFromFile
BOOL GUIAPI DestroyIcon ( HICON  hicon  ) 

Destroys an icon object.

This function destroys the icon object hicon.

Parameters:
hicon The icon object.
Returns:
TRUE on success, otherwise FALSE.
See also:
CreateIconEx, LoadIconFromFile
void GUIAPI DrawIcon ( HDC  hdc,
int  x,
int  y,
int  w,
int  h,
HICON  hicon 
)

Draws an icon into a box.

This function draws an icon object hicon into a box specified by (x,y,w,h).

Parameters:
hdc The device context.
x The x coordinate of the upper-left corner of the box.
y The y coordinate of the upper-left corner of the box.
w The width of the box.
h The height of the box.
hicon The icon object.
See also:
CreateIconEx, LoadIconFromFile
BOOL GUIAPI GetIconSize ( HICON  hicon,
int *  w,
int *  h 
)

Gets the size of an icon object.

This function gets the size of the icon object hicon.

Parameters:
hicon The icon object.
w The width of the icon will be returned throught this buffer.
h The height of the icon will be returned throught this buffer.
Returns:
TRUE on success, otherwise FALSE.
See also:
CreateIconEx, LoadIconFromFile
HICON GUIAPI LoadIconFromFile ( HDC  hdc,
const char *  filename,
int  which 
)

Loads an icon from a Windows ICO file.

This function loads an icon from a Windows ICO file named filename and creates an icon object. This function can load mono-,16-color and 256-color icons.Some Windows ICO file contain two icons in different sizes. You can tell this function to load which icon though which, 0 for the first icon, and 1 for the second icon. Generally, the later icon is the larger icon.

Parameters:
hdc The device context.
filename The file name of the ICO file.
which Tell the function to load which icon.
Returns:
The handle to the icon object, zero means error occurred.
See also:
CreateIconEx
HICON GUIAPI LoadIconFromMem ( HDC  hdc,
const void *  area,
int  which 
)

Loads an icon from a memory area.

This function loads an icon from a memroy area pointed to by area. The memory area has the same layout as the M$ Windows ICO file. This function can load mono- ,16-color and 256-color icons. Some Windows ICO file contain two icons in different sizes. You can tell this function to load which icon though which, 0 for the first icon, and 1 for the second icon. Generally, the later icon is the larger icon.

Parameters:
hdc The device context.
area The pointer to the memory area.
which Tell the function to load which icon.
Returns:
The handle to the icon object, zero means error occurred.
See also:
CreateIconEx
Generated on Thu Apr 7 16:01:48 2011 for MiniGUI V3.0.12 API Reference by  doxygen 1.6.3