CMFCToolBarImages::AddImage

Adds a bitmap to the toolbar images.

int AddImage(
   HBITMAP hbmp,
   BOOL bSetBitPerPixel=FALSE 
);
int AddImage(
   const CMFCToolBarImages& imageList,
   int nIndex 
);

Parameters

  • [in] hbmp
    The handle to the bitmap to add.

  • [in] bSetBitPerPixel
    TRUE if the CMFCToolBarImages Class object uses the color depth (bits per pixel) of the new image; FALSE if the CMFCToolbarImages object keeps the current color depth.

  • [in] imageList
    A reference to a CMFCToolbarImages object that contains the image to add.

  • [in] nIndex
    The index in the source CMFCToolbarImages object of the image to add.

Return Value

The number of toolbar images that the CMFCToolBarImages Class object maintains after the new bitmap was added successfully; -1 if the operation failed.

Requirements

Header: afxtoolbarimages.h

See Also

Reference

CMFCToolBarImages Class

Hierarchy Chart