Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS General Discussion » CExtReportGridWnd doesn't accept more than 256 color bitmap to be displayed in the cell ? Collapse All
Subject Author Date
David Lee Feb 8, 2007 - 5:19 AM

Hi !!

Just want to make sure...
CExtReportGridWnd doesn’t accept more than 256 color bitmap to be displayed in the cell ?
The given example, ReportGrid, all uses 256 color bitmaps loaded from the resource.
All resource bitmaps are stored in the following directory.
...\ReportGrid\res\DataRowBmps

What-if I need to use 32bit color external bitmap file ?
Even though there has been no error as I’ve tested, nothing is displayed in the cell.

-------------------------------------------------------------------------------------------

pBmp = _GetAndLoadBitmap( _dr.LargePhoto_AdditionalInformation );
ASSERT( pBmp != NULL );
pCell = pRGI->PreviewAreaGet( RUNTIME_CLASS(CExtGridCellPictureRef) );
ASSERT_VALID( pCell );
((CExtGridCellPictureRef*)pCell)->BitmapSetBuffer( pBmp );

//
CString strFileName;
// Even though pBmp variable is read from a 32bit bitmap file,
// the below really works fine. (meaning it is saved in the directory but it is not displayed in the cell.
strFileName.Format("C:\\Large %d.bmp", _dr.LargePhoto_AdditionalInformation);
pBmp->SaveBMP_File(strFileName);
//

-------------------------------------------------------------------------------------------------

I’ve reduced the color depth of the sample bitmap files.
Those were displayed correctly.
But if I didn’t reduce the color depth, no image displayed.
So do I have to use only 256 color bitmap to be displayed ?

Thank you in advance.

Technical Support Feb 8, 2007 - 8:23 AM

Indeed there are images of 256 color depth are displayed in the ReportGrid sample. This however does not mean you cannot display 32-bit color images. Take a look at the ProfUIS Controls sample (the Grid tab) where you can find 32-bit color images. Please note all the 30+ grid cells (including CExtGridCellPicture ) can be used in any of the grid windows supported in Prof-UIS: CExtReportGridWnd, CExtTreeGridWnd, CExtPropertyGridCtrl and CExtGridWnd.

David Lee Feb 8, 2007 - 8:38 PM

Really thank you for the answer.

If I use CExtBitmap::LoadBMP_Resource, there is no problem with displaying various color depth images like 256, 32bit...
As you said, the ProfUIS Controls sample (the Grid tab) ,where I can find 32-bit color images, shows this case.
And absolutely no problem. It is because every image is loaded from the resource. Not from memory or external file.

However, If I use CExtBitmap::LoadBMP_Buffer, the successfully loaded bitmap is not displayed in the grid cell.
The loaded bitmap has no problem with being saved and displayed using other graphic programs.
But not displayed in the grid cell.

This may be something bug.
Check it out if you like.

Technical Support Feb 9, 2007 - 12:41 PM

The loading APIs in the CExtBitmap class is based on serialization from a CArchive object. So the same code is used for reading a bitmap from a file, a resource and a memory buffer. We need more details about your project so we can help you. Would you send a test project that demonstrates the problem to us?