Icons bkg color in ReportCtrl
Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Report Control
Forum Description: Topics Related to Codejock Report Control
URL: http://forum.codejock.com/forum_posts.asp?TID=13877
Printed Date: 29 September 2024 at 7:18pm Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com
Topic: Icons bkg color in ReportCtrl
Posted By: securigy
Subject: Icons bkg color in ReportCtrl
Date Posted: 31 March 2009 at 1:49pm
I have the following code when setting up my report control:
// bkg color of the sorted column
pListCtrl->SetSortBackColor(RGB(235,235,235));
// create image list and associate it with the listctrl
CBitmap bitmap;
bitmap.LoadBitmap(IDB_TREE_ICONS); m_ImageList.Create(16, 16, ILC_COLOR24|ILC_MASK, 6, 1); m_ImageList.Add(&bitmap, RGB(255,0,255)); m_BtListCtrl.SetImageList(&m_ImageList, LVSIL_SMALL);
the result looks like that:
that is, the bkg color of the icon displayed white instead of grey of RGB(235,235,235)
the bkg color in the resource bitmap is RGB(255,0,255)
https://forum.codejock.com/uploads/20090331_084622_CJStatusBar.zip - uploads/20090331_134848_codejock-12-1-i.zip
|
Replies:
Posted By: mdoubson
Date Posted: 01 April 2009 at 11:08pm
What is this question about? CListCtrl? or ReportControl? Report Control have no function SetImageList(&m_ImageList, LVSIL_SMALL); It has function for GetImageManager
//SetImageList(UINT nBitmap, int cx, int nBaseCommand, COLORREF clrMask)
e.g. wndReport.GetImageManager()->SetImageList(IDB_ICONVIEWTEST, 32, 0, RGB(255, 0, 255));
------------- Mark Doubson, Ph.D.
|
Posted By: securigy
Date Posted: 02 April 2009 at 12:53pm
sorry. it is my list control class derived from CXTListCtrl class.
|
Posted By: securigy
Date Posted: 02 April 2009 at 8:21pm
Rephrasing the question. I have the following code that sets the background of the sorted column in my listctrl that is derived from CXTListCtrl:
pListCtrl->EnableUserSortColor(TRUE);
m_nSortedCol = 0;
m_bAscending = TRUE;
pListCtrl->SetSortBackColor(RGB(235,235,235)); // light grey color
SortColumn(m_nSortedCol, m_bAscending);
pListCtrl->RedrawWindow();
Then I have the code that adds image list for the listctrl icons:
// create image list and associate it with the listctrl
CBitmap bitmap;
bitmap.LoadBitmap(IDB_LIST_ICONS);
m_ImageList.Create(16, 16, ILC_COLOR24|ILC_MASK, 6, 1);
m_ImageList.Add(&bitmap, RGB(235,0,235)); // the bitmap resource has grey background
m_BtListCtrl.SetImageList(&m_ImageList, LVSIL_SMALL);
The bottom line is that the icons do not show correctly: there are some 2 white vertical pixels and 1 horizontal... Is it a bug in CXTListCtrl ? or am I doing something wrong here?
|
Posted By: mdoubson
Date Posted: 03 April 2009 at 12:09am
Check CodeProject - CodeGuru site - they have enough info about CListCtrl and derivations
------------- Mark Doubson, Ph.D.
|
|