BOOL CBCGPTagManager::ParseToolBarImages (const CString& strItem, CBCGPToolBarImages& value, LPCTSTR lpszID)
{
	CBCGPTagManager tm (strItem);

	CSize size (value.GetImageSize ());

	value.Clear ();
	value.SetTransparentColor ((COLORREF)(-1));

	tm.ReadSize (s_Size, size);

	BOOL bPreMultiplyCheck = TRUE;
	tm.ReadBool (s_PreMltCheck, bPreMultiplyCheck);

	value.SetPreMultiplyAutoCheck (bPreMultiplyCheck);

	if (size != CSize (0, 0))
	{
		value.SetImageSize (size);
	}

	value.LoadStr (lpszID);

	if (size == CSize (0, 0))
	{
		value.SetSingleImage ();
	}

	COLORREF clrTransparent = CLR_DEFAULT;
	if (tm.ReadColor (s_Transparent, clrTransparent))
	{
		value.SetTransparentColor (clrTransparent);
	}

#ifndef _BCGSUITE_
	if (m_clrBase != (COLORREF)-1 &&
		m_clrTarget != (COLORREF)-1)
	{
		value.AddaptColors (m_clrBase, m_clrTarget);
	}
#endif

    if (CBCGPToolBarImages::IsRTL () && value.GetImageWell () != NULL &&
		clrTransparent == CLR_DEFAULT)
    {
		BITMAP bmp;
		if (::GetObject (value.GetImageWell (), sizeof (BITMAP), &bmp) != 0)
		{
			if (bmp.bmBitsPixel == 32)
			{
				value.Mirror ();
			}
		}
	}

	return TRUE;
}
BOOL CBCGPTagManager::ParseControlRendererParams (const CString& strItem, CBCGPControlRendererParams& value)
{
	CBCGPTagManager tm (strItem);

	CBCGPControlRendererParams params;
	params.SetResourceID (value.GetResourceID ());

#ifndef _BCGSUITE_
	params.SetBaseColor (m_clrBase, m_clrTarget);
#endif

	if (!tm.ReadRect (s_Rect, params.m_rectImage))
	{
		CSize size;

		if (tm.ReadSize (s_Size, size))
		{
			params.m_rectImage = CRect (CPoint (0, 0), size);
		}
	}

	if (params.m_rectImage.IsRectEmpty ())
	{
		return FALSE;
	}

	tm.ReadRect  (s_Corners, params.m_rectCorners);
	tm.ReadRect  (s_Sides, params.m_rectSides);
	tm.ReadRect  (s_Interior, params.m_rectInter);
	tm.ReadColor (s_Transparent, params.m_clrTransparent);
	tm.ReadBool  (s_PreMltCheck, params.m_bPreMultiplyCheck);

	value = params;

	return TRUE;
}