c++ - wxImageList::Add() 总是返回 0
问题描述
根据手册,wxImageList::Add()
应该返回新添加图像的索引位置。
但是在我的应用程序中,我只得到返回值0
(当添加图像正常时)或-1
(当它失败时)。当我调试到函数时
int wxImageList::Add(const wxBitmap& bitmap, const wxColour& maskColour)
这对我来说似乎很清楚:使用 Windows,返回的值来自对ImageList_AddMasked()
//的调用IsolationAwareImageList_AddMasked()
,__IsolationAware_pfn()
后者似乎返回 aBOOL
但不是列表索引值。
所以我的问题是:如何获取最近添加的图像的索引值?
解决方案
显而易见的想法是只使用wxImageList::GetImageCount()
,有什么问题吗?
推荐阅读
- java - 从groovy中的JSON数组中提取特定数据
- oracle - SQL获取列的总数或总和
- c++ - 无法访问公共功能?没有成员命名?
- python - 如何从每行中的字符串中提取年份并使用这些年份生成新行
- cookies - 与 PC 上的所有用户共享 Win10 IE 11 cookie
- r - 我需要帮助弄清楚为什么我的正则表达式与我正在寻找的内容不匹配
- javascript - 如何断言复制到剪贴板的值是正确的?
- amazon-web-services - 为什么将我的云形成设计器保存到 S3 存储桶会挂起?
- matlab - S-Function Level 2 C Simulink (R2006b) , 从参数中获取字符串
- javascript - 具有高阶函数的递归