Thank you for your answer,
I am trying something, but it`s really not working, custom palette
implementation is very poor documented with no example at all, i didn`t find
anything on Internet neither. Can you help me with some simple example how
can i display bitmap done it in custom palette.

This is what i have done but it`s not working:

1. I have bitmap created with custom palette, 248 nuance of brown, and 8
standard colors.   You wrote:
> If you make the bitmap only about 240 colors
> you can avoid changing any colors the UI uses.

Where can i find values of that standard UI 16 colors?
----------------------------------------------------------------------------
---------

2. From ACD PhotoCanvas i created .pal (PaintShop palette file) file from
bitmap, note that some other programs extract palette file with different
queue but same values, is this important :

------------- brown_custom.pal ------------------ (copy/pasted)
255 255 255 ---> first line of pal file
255 255 0
255 0 255
255 0 0
0 255 255
0 255 0
0 0 255
0 0 0
154 65 6
181 110 30
124 45 12
178 123 52
199 140 62
....
...
..
.
86 22 9
65 11 1
79 17 6
0 0 0   ---> last, 256 line of file

----------------------------------------------------------------------------
-------------

3. In RSC file i insert this:

BITMAPFAMILY ID 2800
COMPRESS
BEGIN
      BITMAP "black_white.bmp" BPP 1
      BITMAP "low_densiti.bmp" BPP 8  NOCOMPRESS DENSITY 72
      BITMAP "hi_densiti.bmp" BPP 8  NOCOMPRESS DENSITY 144
      BITMAPPALETTE "custom_palette.pal"
END

PALETTE ID 1000 "custom_palette.pal"

// both colored bitmaps created with custom_palette
----------------------------------------------------------------------------
------------------
4. In source insert:

 h = DmGetResource('Tbmp', (int)bmpID);
 ErrFatalDisplayIf(h == NULL, "Missing Bitmap Resource!");
 bp = (BitmapPtr)MemHandleLock(h);
 int size = MemHandleSize (h)/sizeof(RGBColorType);
 WinPalette(winPaletteSet, 0, size,(RGBColorType*)bp);
 WinDrawBitmap(bp, x, y);
 MemHandleUnlock(h);
 DmReleaseResource(h);

or:
WinPalette(winPaletteSet, 0, 16,
           (RGBColorType *)MemHandleLock(h));
----------------------------------------------------------------------------
-------------------


When i done this color are messed up bitmap is green and black.
Can you tell me where i do wrong or if you have some advice or some simple
example, i will be very appreciative.
Thank you.

Vladan Markovic



"Tim Kostka" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Palm OS has custom palette support via WinPalette.  So yes, it's able to
> display any 256 colors you tell it to.  However, changing the palette
> changes the UI colors as well.  If you make the bitmap only about 240
colors
> you can avoid changing any colors the UI uses.  Anyhow, there you are.
> ---
> Tim Kostka
>
> "Vladan Markovic" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > Hi,
> >
> > I am developing graphic application for Palm OS in 256 colors, it
happens
> > that designer done some design in 256 colors, but in custom palette, 256
> > nuances of the same color, i heard that Palm OS have support for custom
> > palette (with some programers work around), is that means that it can
> > REALY
> > display 256 nuances of that color on 256 color depth devices, or it will
> > convert to standard palette and then display it (with lose of quality)?
> >
> > This is question of great importance, tnx to all people for answer.
> >
> >
> >
>
>
>



-- 
For information on using the Palm Developer Forums, or to unsubscribe, please 
see http://www.palmos.com/dev/support/forums/

Reply via email to