问个VC中cimagelist的问题
m_imagelist.Create(32,32,ILC_COLOR32|ILC_MASK,0,0)
这样一句话中,最后两个参数0,0有什么含义吗?不是很明白.
看一下MSDN便知,cimagelist::Create()函数共有5种重载形式,你用的是BOOL Create( int cx, int cy, UINT nFlags, int nInitial, int nGrow )这种.其中nInitial的解释是Number of images that the image list initially contains,大意应该是“最初列出的图像张数”;nGrow的解释是
Number of images by which the image list can grow when the system needs to resize the list to make room for new images. This parameter represents the number of new images the resized image list can contain,大意应该是“图像的图像列表可以增长时,系统需要调整,以腾出空间给新的图像列表的数目.此参数表示新的图像调整大小的图像列表可以包含的数量”.
0,0这是零,零!就是最初列出零张图像,新的图像调整大小的图像数也是零。
那是一个函数参数,你就是不用也得写一个啊,那你写什么呢?什么都不写就不是你调用的这个五个参数的函数了,就成了四个参数的另一个函数了;如果连前一个0也不写,那又成了三个参数的函数了!你写了0,那就既调用了这个五形参的Creat()函数,又不关心这最后两个参数,这有什么不合适吗?
本文来自电脑杂谈,转载请注明本文网址:
http://www.pc-fly.com/a/jisuanjixue/article-21549-1.html
只有他不像那样耍赖坐滩
为什么要彼此伤害
有才华的人我都喜欢