Minigui学习--icon
来源:互联网 发布:软件基础培训 编辑:程序博客网 时间:2024/06/05 15:31
icon类型:HICON
定义在/minigui/gdi.h文件中
1.创建icon
/**
* \fn HICON GUIAPI CreateIconEx (HDC hdc, int w, int h, \
const BYTE* AndBits, const BYTE* XorBits, int colornum, \
const RGB* pal)
* \brief Creates an icon object from the memory.
*
* This function creates an icon from memory data rather than icon file.
* \a w and \a h are the width and the height of the icon respectively.
* \a pANDBits and \a pXORBits are AND bitmask and XOR bitmask of the icon.
* MiniGUI currently support mono-color cursor 256-color icon and 16-color icon,
* \a colornum specifies the cursor's color depth. For mono-color, it should
* be 1, and for 16-color cursor, it should be 4.
*
* \param hdc The device context.
* \param w The width of the icon.
* \param h The height of the icon.
* \param AndBits The pointer to the AND bits of the icon.
* \param XorBits The pointer to the XOR bits of the icon.
* \param colornum The bit-per-pixel of XOR bits.
* \param pal The palette of icon.
* \return The handle to the icon object, zero means error occurred.
*
* \sa LoadIconFromFile
*/
MG_EXPORT HICON GUIAPI CreateIconEx (HDC hdc, int w, int h,
const BYTE* AndBits, const BYTE* XorBits, int colornum,
const RGB* pal);
/**
* \def CreateIcon
* \sa CreateIconEx
*/
#define CreateIcon(hdc, w, h, AndBits, XorBits, colornum) \
CreateIconEx(hdc, w, h, AndBits, XorBits, colornum, NULL)
2.从文件中加载icon
/**
* \fn HICON GUIAPI LoadIconFromFile (HDC hdc, const char* filename, int which)
* \brief Loads an icon from a Windows ICO file.
*
* This function loads an icon from a Windows ICO file named \a 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 \a which,
* 0 for the first icon, and 1 for the second icon. Generally, the later
* icon is the larger icon.
* \param hdc The device context.
* \param filename The file name of the ICO file.
* \param which Tell the function to load which icon.
* \return The handle to the icon object, zero means error occurred.
*
* \sa CreateIconEx
*/
MG_EXPORT HICON GUIAPI LoadIconFromFile (HDC hdc, const char* filename,
int which);
3.绘制icon
/**
* \fn void GUIAPI DrawIcon (HDC hdc, \
int x, int y, int w, int h, HICON hicon)
* \brief Draws an icon into a box.
*
* This function draws an icon object \a hicon into a box specified by
* \a (x,y,w,h).
*
* \param hdc The device context.
* \param x The x coordinate of the upper-left corner of the box.
* \param y The y coordinate of the upper-left corner of the box.
* \param w The width of the box.
* \param h The height of the box.
* \param hicon The icon object.
*
* \sa CreateIconEx, LoadIconFromFile
*/
MG_EXPORT void GUIAPI DrawIcon (HDC hdc,
int x, int y, int w, int h, HICON hicon);
4.销毁icon
/**
* \fn BOOL GUIAPI DestroyIcon (HICON hicon)
* \brief Destroys an icon object.
*
* This function destroys the icon object \a hicon.
*
* \param hicon The icon object.
* \return TRUE on success, otherwise FALSE.
*
* \sa CreateIconEx, LoadIconFromFile
*/
MG_EXPORT BOOL GUIAPI DestroyIcon (HICON hicon);
- Minigui学习--icon
- minigui学习笔记-按钮
- MiniGUI学习笔记
- MINIGUI学习总结一
- MINIGUI学习总结
- Minigui的深入学习
- 继续学习minigui!!
- 深入学习minigui!
- Minigui学习---字符集
- Minigui学习--RECT
- Minigui学习--绘制
- Minigui学习--DC
- Minigui学习--光标
- Minigui学习--font
- 学习miniGUI的问题
- MINIGUI学习总结一
- 开始学习MiniGUI(minigui学习过程及常见问题解答)
- MiniGUI的消息机制学习
- Levelset ---GAC
- MyGUI FAQ
- JMeter与LoadRunner的比较
- OpenCV将多幅BMP压缩成AVI文件
- Nginx下载、编译、启动/停止/平滑重启、文档
- Minigui学习--icon
- 搜索引擎抓取系统概述
- javascript 闭包小结
- nmon与nmonanalyser 系统性能分析(图表)利器非草稿
- android 的unregisterReceiver报错处理
- android 弹出式对话框实现自定义菜单栏
- Index-Organized Table和Clustered Table(转)
- UVa10311 - Goldbach and Euler
- 转自知乎:一个有效的新产品上线策略包括哪些考虑因素