C++ MFC关于Create函数

2025-03-29 09:55:20
推荐回答(2个)
回答1:

原型为:
BOOL Create( int cx, int cy, UINT nFlags, int nInitial, int nGrow );

其中各项参数的含义为:
cx定义图像的宽度,单位为象素;
cy定义图象的高度,单位为象素;
nFlags确定建立图像列表的类型,能够是以下值的组合:ILC_COLOR、ILC_COLOR4、ILC_COLOR8、ILC_COLOR16、ILC_COLOR24、ILC_COLOR32、ILC_COLORDDB和ILC_MASK;
nInitial用来确定图像列表包含的图像数量;
nGrow用来确定图像列表可控制的图像数量。

回答2:

Create 初始化图像列表并绑定对象
图像控制的建立方法如下:
BOOL Create( int cx, int cy, UINT nFlags, int nInitial, int nGrow );
BOOL Create( UINT nBitmapID, int cx, int nGrow, COLORREF crMask );
BOOL Create( LPCTSTR lpszBitmapID, int cx, int nGrow, COLORREF crMask );
BOOL Create( CImageList& imagelist1, int nImage1, CImageList& imagelist2,int nImage2,int dx, int dy );
其中各项参数的含义为:cx定义图像的宽度,单位为象素;cy定义图象的高度,单位为象素;nFlags确定建立图像列表的类型,可以是以下值的组合: ILC_COLOR、ILC_COLOR4、ILC_COLOR8、ILC_COLOR16、ILC_COLOR24、ILC_COLOR32、 ILC_COLORDDB和ILC_MASK;nInitial用来确定图像列表包含的图像数量;nGrow用来确定图像列表可控制的图像数量。
NbitmapID 用来确定图像列表联系的位图标志值;crMask表示颜色屏蔽位;
LpszBitmapID 用来确定包含位图资源的标识串;
imagelist1 指向图像列表控制对象的一个指针;nImage1图像列表1中包含的图像数量;imagelist2指向图像列表控制对象的一个指针;nImage2图像列表2中包含的图像数量;dx表示以象素为单位的图像宽度;dy表示以象素为单位的图像高度。