256 Color Palette not sticking 
Author Message
 256 Color Palette not sticking

Hi all,

I am new to VB programming and have VB 3.0.  I am working on an app which
needs to utilize a 256-color palette with a 6-bit grayscale and a 6-bit
blue scale, and 128 other empty colors.

I have a bitmap which contains this palette (256 colors) and I load it
into a picture box.  It comes out looking a bit washed, with perhaps only
16 grays (instead of 64 grays) and 2 or 4 blues (instead of 64 blues)
coming through.  I get a similar result if I try a line ()-(), RGB() and
try to draw a gray or blue scale.

I have loaded the image into a palette program and all of the elements of
the scales for the palette are in there!

Why is VB insisting on not matching up the colors, even when I specify a
specific color on any of those scales when I know they are in the palette!

Where am I going wrong?  Anyone have any other suggestions?

And yes, I have a 256 color driver and the like running.  I am running
under OS/2 Warp - but I have never had any other color problems, so I do
not expect that to be the cause.


Joint Education Initiative
3433 A. V. Williams
University of Maryland at College Park
| Flames > /dev/nul                                                          |

Sat, 28 Feb 1998 03:00:00 GMT  
 256 Color Palette not sticking
The first problem is that you really don not 256 colors to play with in
VB.  There 20 colors that are required by Windows, called the system
colors, for such things as button faces, disabled colors, window border
colors, ect.  Although these can be changed by an API call, it is not
recommened due to the global effect it has on the look of windows.  

The second thing you must keep in mind is that the control that has focus
has priority over what colors are in the palette.  If you are using
multiple controls to display pictures, make certain they all have the
same palette in the same palette order.

For more info you will want to check out the palette manager section of
the Window's API documents.

Sun, 01 Mar 1998 03:00:00 GMT  
 256 Color Palette not sticking
        This seems very strange. Lines and things traditionally don't come out
the way you expect in VB, but 256-color bmps are supposed to be OK. Also
256-color bmps work fine for me - in fact the officially recommended way to
set the palette for a VB form is to add a 1x1 bmp in the corner that has the
palette you want.
        If I try to draw 100 lines with 100 different shades of gray it fails
miserably. If I do the kludge and first load a 1x1 bmp that contains 100
shades of gray then my 100 gray lines come out just fine.

David Ullrich
Don't you guys find it tedious typing the same thing
after your signature each time you post something?
I know I do, but when in Rome...

Mon, 02 Mar 1998 03:00:00 GMT  
 [ 3 post ] 

 Relevant Pages 

1. color palette not accessible in 256+ color settings

2. grid congtrol not responding to 256 color palette requests

3. Using 256 color Palettes in High/True Color

4. choose a color in a 256 color palette ?

5. Change Screen Color Palette from 256 to hi-color in VB

6. Bitmap Color Palette editing-VB4 16 bit 256 color

7. Coloring a control from a 256-Color palette

8. Coloring a control from a 256-Color palette

9. Bitmap Color Palette editing-VB4 16 bit 256 color

10. 256 Color Palette

11. halftone palette/256 colors

12. Custom 256-color palettes - how??


Powered by phpBB® Forum Software