DIB demo code project thingy wotsit.
-----------------------------------

Donated as ever to the Public domain by me
John Biddiscombe (Lord of Darkness - Don't ask)
J.Biddiscombe@rl.ac.uk

-----------------------------------------
this is for 256 colour display modes only
-----------------------------------------

I always use 236 colour palettes to spare windows the grief of mucking up my
colours. The demo draws all 256 - do loop 10...246 if you don't want the others

basically assume you have 236 colours and plot 10 upwards.
the sinusoid demo covers it nicely.

-
also
 in the Create method for the DIB_surface_object the Pal_indices are allowed
 an offset, I've used 0, but if you put 10 in, then your colours can be
 accessed from 0-235 instead of 10-245.

You can use all the normal API calls to draw on the DIB, just use the DC of
the DIB and moveto,lineto as normal.

I use the DIB really only for doing colour plots of 2D data, so I select
(usually HSV) a palette and just plot pixels.

I also have code for Bresenham line drawing, Transparent sprite copying
in assembler - fast - no bitblts - and various useful stuff, but this is not
finished by a long way, or urgent, so This is as much as I've done.

Added bresenham now.

NB - some of the palettes I've included are not 236 entries,
EG CHROMA.PAL...
The palette creation routine in Palunit, wraps the colours round if there are less
than 236, you should check the pal_colours variable if you want to do something
like the sinusoid without dodgy colours appearing.

Nearly all my programs use ONE palette at a time, so if you have an MDI type
program and need different palettes in different windows, then I guess you know
what you are doing and don't need my help modifying this code.

I must thank the Fractint/WinFract team for allowing me to steal their palettes
and distribute them. For an example of these palettes in action have a look
at Zonerings on my pisspoor web page ftp://ftp.cc.rl.ac.uk/pub/zone/zpage1.htm


Hope this helps someone.

John B


