to post a new message or reply to an existing one. If you are not registered, please
NOTE: Some forums may be read-only if you are not currently subscribed to
our technical support services.
Feb 18, 2007 - 10:31 PM
I want to use VISTA high resolution icons for ribbonbar.
When I include such high resolution icon then I’m getting compilation error.
error RC2176 : old DIB in res\coordinate_frame_3points.ico; pass it through SDKPAINT.
Can you tell me how can I load such icons for my ribbonbar buttons?
Thanks & Regards,
Feb 20, 2007 - 3:57 AM
The MSDN says: An old format Device Independent Bitmap was found in the specified file. It should be converted to the current format.
It is a known issue when the Vista compressed icons on Visual C++ 6.0 and Visual .NET 2003 are rejected by the resource compiler. This is because the new ICO file format introduces a new header which points to raw PNG data. Of course the compiler crashes and returns a false error message. The DIB header is not old, it is PNG. Passing it through SDKPAINT does not help.
In Prof-UIS there is a
CExtBitmap class that supports 32-bit BMP files with alpha channel and the
CExtBitmap::AlphaBlend() method paints any such a bitmap on any Windows OS. Although it completely meets your requirements, there are two problems with 32-bit high quality bitmap images:
1) You should spend some time for painting these images or have them created for you.
2) Many applications destroy and/or corrupt (or simply ignore) alpha channel in BMP files. For instance, the Adobe Photoshop does not save alpha channel into exported BMP files. You have to save your image as PNG and then convert it to BMP using some other tool like Axialis Icon Workshop. Alternatively, you can load PNG images using the
CExtSkinBitmap class provided with the ProfSkin library. The later comes with Prof-UIS.
The ..\Prof-UIS\Samples\FunnyBars\Res.IDR_TOOLBAR_VISTA_ICONS.bmp file is a 32-bit BMP file with alpha channel. It is not displayed correctly neither by the Windows shell viewer nor by the MSPaint bitmap editor nor by built in bitmap editor of any Visual Studio. This bitmap is used in the
CMainFrame::m_wndToolBarVista toolbar window of the FunnyBars sample and there are no some special steps that create the toolbar there. This toolbar is initialized by using the ordinary
You can initialize any
CExtCmdIcon object with 32-bit bitmap with alpha channel. Simply load this bitmap into the
CExtCmdIcon::m_bmpNormal property. The initialized icon object can be assigned to the command description in the command manager and you will see it both in toolbars and menus.
There is a FAQ How to load a PNG image from a file and use it in my application? which can be helpful in this