CToolBarCtrl::AddBitmap

添加一个或多个按钮图像到按钮图像列表在工具栏控件存储的。

int AddBitmap( 
   int nNumButtons, 
   UINT nBitmapID  
); 
int AddBitmap( 
   int nNumButtons, 
   CBitmap* pBitmap  
);

参数

  • nNumButtons
    按钮图像的数字在位图中。

  • nBitmapID
    包含按钮图像或图形添加位图的资源标识符。

  • pBitmap
    对包含按钮图像或图形添加的 CBitmap 对象的指针。

返回值

第一个新图像的从零开始的索引,如果成功;否则– 1。

备注

可以使用Windows API CreateMappedBitmap 在添加位图之前映射颜色添加到工具栏。 如果通过指向 CBitMap 对象,则必须确保销毁位图,在销毁后工具栏。

要求

Header: afxcmn.h

请参见

参考

CToolBarCtrl Class

层次结构图

CToolBarCtrl::AddButtons

CToolBarCtrl::InsertButton

CToolBarCtrl::AddString

CToolBarCtrl::AddStrings