示例#1
0
//***********************************************************************************
void CBCGPMenuImages::SetColor (CBCGPMenuImages::IMAGE_STATE state,
							COLORREF color)
{
	Initialize ();

	CBCGPLocalResource locaRes;

	CBCGPToolBarImages imagesTmp;

	imagesTmp.SetImageSize (CSize (iImageWidth, iImageHeight));
	imagesTmp.Load (globalData.Is32BitIcons () ? IDB_BCGBARRES_MENU_IMAGES24 : IDB_BCGBARRES_MENU_IMAGES);
	imagesTmp.SetTransparentColor (clrTransparent);

#ifndef _BCGSUITE_
	if (imagesTmp.IsRTL ())
	{
		CBCGPToolBarImages::MirrorBitmap (imagesTmp.m_hbmImageWell, imagesTmp.GetImageSize ().cx);
	}
#endif

	CBCGPToolBarImages& images = (state == ImageBlack) ? m_ImagesBlack :
					(state == ImageGray) ? m_ImagesGray : 
					(state == ImageDkGray) ? m_ImagesDkGray : 
					(state == ImageLtGray) ? m_ImagesLtGray : 
					(state == ImageWhite) ? m_ImagesWhite : m_ImagesBlack2;

	if (color != (COLORREF)-1)
	{
		imagesTmp.MapTo3dColors (TRUE, RGB (0, 0, 0), color);
	}

#ifndef _BCGSUITE_
	if (!m_bInitializing)
	{
		imagesTmp.SmoothResize (globalData.GetRibbonImageScale ());
	}
#endif

	images.Clear ();
	imagesTmp.CopyTo (images);
}