VisualC++ 6 and 16/24/32 bitmaps

Started by
6 comments, last by Silly_con 18 years, 3 months ago
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
Advertisement
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 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.
.
Thanks very much!
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
I believe the solution for both problems would be to use owner-drawn buttons. You can find more information on MSDN or CodeProject.com. =)
:==-_ Why don't the voices just leave me alone?! _-==:
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

"Those who would give up essential liberty to purchase a little temporary safety deserve neither liberty nor safety." --Benjamin Franklin

Thanks again! I now have material to read and test :)

This topic is closed to new replies.

Advertisement