VisualC++ 6 and 16/24/32 bitmaps
Hi, I am making a little win32 application, buttons, textbox etc, and I want buttons with bitmaps, or icons inside, the problem is that when I add a resource bitmap, it converts it to 16 colors I believe, and it looks awful, how can i import full color (true color) bitmaps and icons in vc6 ?
thanks
Hi,
You can manually add the resources to the rc file yourself. If the resource editor is used to insert them, it will create images in a different format and add those to the rc file.
Create a resource.rc file and put this in it:
#include "Resource.h"
// Bitmap
IDB_STUFF1 BITMAP DISCARDABLE "stuffa.bmp"
IDB_STUFF2 BITMAP DISCARDABLE "stuffb.bmp"
// Icon
//
// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
IDI_MAIN ICON DISCARDABLE "main.ico"
The resources will be compiled in just as they exist in the files you link it to. Also remember to make a resource header to define the constants.
You can manually add the resources to the rc file yourself. If the resource editor is used to insert them, it will create images in a different format and add those to the rc file.
Create a resource.rc file and put this in it:
#include "Resource.h"
// Bitmap
IDB_STUFF1 BITMAP DISCARDABLE "stuffa.bmp"
IDB_STUFF2 BITMAP DISCARDABLE "stuffb.bmp"
// Icon
//
// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
IDI_MAIN ICON DISCARDABLE "main.ico"
The resources will be compiled in just as they exist in the files you link it to. Also remember to make a resource header to define the constants.
You should also be able to simply Import them into the resource bitmap folder. Well, at least you can import true color .bmp files without them being changed. On the otherhand, if you try pasting one in, it will be changed.
Hi again, sorry, but i have another question !!! :)
1. How I can make a bitmap that can be clicked ? or a button bitmap.
2. How I can make buttons like in internet explorer 6 of windows XP, like back button (icon + text)
All without using MFC, only win32 api in c/c++.
Thanks
1. How I can make a bitmap that can be clicked ? or a button bitmap.
2. How I can make buttons like in internet explorer 6 of windows XP, like back button (icon + text)
All without using MFC, only win32 api in c/c++.
Thanks
I believe the solution for both problems would be to use owner-drawn buttons. You can find more information on MSDN or CodeProject.com. =)
Hope these links help:
http://www.gamedev.net/community/forums/topic.asp?topic_id=80888
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/commctls/buttons/buttons.asp
http://www.codeproject.com/buttonctrl/FooButton.asp
http://www.gamedev.net/community/forums/topic.asp?topic_id=80888
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/commctls/buttons/buttons.asp
http://www.codeproject.com/buttonctrl/FooButton.asp
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement