PDA

View Full Version : 8bit Color



Rayven
9th August 2006, 01:11
I am developing a application on a Solaris 8 machine. Due to a legacy piece of software (not being replaced...yet) the machine is set to 8 bit color. Because of this, all the .png images I use for toolbar icons are appearing only in black and white. The images I am using are coming from the demos directory of the Qt installation. I have tried converting the images using M$ Paint to 8bit gifs, jpegs, and PNG, but all only appear in greyscale. Is there a particular trick to use 8 bit color images in Qt, or am I just converting the images incorrectly?

e8johan
9th August 2006, 06:55
I'm not sure, but perhaps you could load the icons as a QImage and convert it to a QPixmap. This might trigger some conversion code fixing the colours.

Chicken Blood Machine
9th August 2006, 22:47
8-bit color means you are working with a shared colormap. If your images are in the wrong color (i.e. black and white) it's probably because all available cells have been allocated by the desktop and other applications.

There are a number of different ways to address this:

1. Start from a fresh login with as few applications running as possible. See if it still happens.
2. Your video card probably supports higher color visuals (running 'xdpyinfo' in a terminal will tell you this). If this is the case, start your app with '-visual TrueColor' on the command line and see if your app starts in 24-bit color.
3. Start your app with '-cmap' this should force the ap to use a private color map. It may well result in 'color flashing' though when the mouse pointer moves between windows.

Rayven
10th August 2006, 15:54
Thanks Chicken Blood Machine, the "-visual TrueColor" did not work, but "-cmap" did. However, the 'color flashing' was more of completly changing the desktop colors when the window was selected. Thanks again CBM :D

Chicken Blood Machine
10th August 2006, 19:19
Thanks Chicken Blood Machine, the "-visual TrueColor" did not work, but "-cmap" did. However, the 'color flashing' was more of completly changing the desktop colors when the window was selected. Thanks again CBM :D

Yeah that's what I meant. The 24-bit TrueColor option, will work if you can get a Systems Administrator to configure your Sun box with 24-bit visual support, but a default visual of 8-bit. then your legacy app will still run fine in 8-bit color, but your Qt app should be able to make use of a truecolor visual (without the flashing).