Hello everyone,

Since it's a quiet day on comp.sys.psion.misc I thought I'd post a
little program that I wrote this morning, to show me the palette in each
of the graphics modes on my EPOC32 machines. The program will show
palettes up to 4096 colours, on everything from the Osaris to the
Netbook, and possibly some machines running Symbian 6 and beyond.

You can use the screen grab feature on your handheld to save the
resulting screen shot in a file. I used this to create specific
palettes in my desktop graphics package, so I could use the desktop
machine to dither images down to the 16- and 256-colour EPOC palettes.

Here's the program, to cut and paste into the OPL editor; feel free to
do with it what you will:

REM
REM Palette.opl - display the full palette
REM Copyright (C) Damian Walker 2008
REM

REM - Main Program
PROC Palette:
LOCAL id%,mode%
mode%=GetMode%:
ShowPalette%mode%)
gIPRINT "Press a key"
GET
ENDP

REM -- Ask use for the mode
PROC GetMode%:
LOCAL mode&
dINIT "Graphics mode"
dLONG mode&,"Mode",0,7
dBUTTONS "Ok",$10d
DIALOG
RETURN mode&
ENDP

REM -- Show the palette
PROC ShowPalette%mode%)
LOCAL id%
LOCAL red%,green%,blue%
LOCAL blockx%,blocky%,x%,y%
id%=gCREATEBIT(gWIDTH,gHEIGHT,mode%)
blockx%=gWIDTH/64
blocky%=gHEIGHT/64
WHILE red%<16
WHILE green%<16
WHILE blue%<16
x%=(red%+$10*(blue% AND $C)/$4)*blockx%
y%=(green%+$10*(blue% AND $3))*blocky%
gCOLOR red%*$11,green%*$11,blue%*$11
gAT x%,y%
gFILL blockx%,blocky%,0
blue%=blue%+$1
ENDWH
blue%=0
green%=green%+$1
ENDWH
green%=0
red%=red%+$1
ENDWH
gUSE 1
gCOPY id%,0,0,gWIDTH,gHEIGHT,3
gCLOSE id%
ENDP

--
Damian - http://psion.snigfarp.karoo.net/
For email replies, substitute "psion" for "damian" in my email address.