Print Page | Close Window

Gallery items not showing

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=6887
Printed Date: 12 November 2025 at 3:52pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Gallery items not showing
Posted By: BastianPL
Subject: Gallery items not showing
Date Posted: 16 April 2007 at 3:54pm

Hi,

 

Anybody can tell me why images are not showing in gallery ???
I need to load separate bitmaps from resource to show them in gallery control:

 

Code 1 : -> Onlyone bitmap to show -> doesnt work

m_pDatabases = CXTPControlGalleryItems::CreateItems( pCommandBars, ID_GALLERY_DATABASE );

ASSERT( m_pDatabases != NULL );

m_pDatabases->GetImageManager()->SetMaskColor(RGB(255,0,255));

m_pDatabases->GetImageManager()->SetIcons(IDB_FLAG_ENGLAND, 0, 0, CSize(32, 32));

//m_pItems->SetItemSize(CSize(56, 56));

m_pDatabases->AddItem(0, 0);

 
Code 2) Loading images to imagelist -> doesnt work
UINT uiFlags[]= { IDB_FLAG_UNITED_KINGDOM,

IDB_FLAG_ENGLAND, IDB_FLAG_SCOTLAND, IDB_FLAG_WALES, IDB_FLAG_NORTHERN_IRELAND,

IDB_FLAG_EUROPEAN_UNION, IDB_FLAG_UNITED_STATES_OF_AMERICA, IDB_FLAG_CANADA, IDB_FLAG_AUSTRALIA, IDB_FLAG_NEW_ZEALAND, -1 };

m_pItemsDatabase->GetImageManager()->SetMaskColor(RGB(255,0,255));

CImageList img;

img.Create(48,48,ILC_COLOR32 | ILC_MASK, 0,1);

for (int i = 0; i < _countof(uiFlags); i++)

{

 CBitmap bmp;

 bmp.LoadBitmap(uiFlags[i]);

 img.Add(&bmp, RGB(255,0,255));

 bmp.DeleteObject();

}

m_pItemsDatabase->GetImageManager()->SetIcons(img, 0, 0, CSize(48, 48));

m_pItemsDatabase->SetItemSize(CSize(56, 56));

for (int nStyle = 0; nStyle < _countof(uiFlags); nStyle++)

{

 CXTPControlGalleryItem* pItem = m_pItemsDatabase->AddItem(nStyle, nStyle);

}

Do anybody know the solution ?
 


-------------
Bastian



Replies:
Posted By: Oleg
Date Posted: 17 April 2007 at 12:39am
Hi,
 
try instead ILC_COLOR32  use ILC_COLOR24 if you have masked bitmaps.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net