Q. I have set a transparent colour, however when using HIF this colour is not transparent. This previously worked with BMP files, why is this?

Standard BMP files are 24 bit whilst the HIF file uses 16 bit HIF files therefore when the files are converted all the colours are adjusted.

You can use the following algorithm to work out the colour from a 24 file to a 16 HIF file:

red = (unsigned short) ((red & 0x00f8) << 7);
green = (unsigned short) ((green & 0x00f8) << 2);
blue = (unsigned short) ((blue & 0x00f8) >> 3);

data16 = (unsigned short) ( red | green | blue | alpha);

An example of this is using the colour white which is R 255 G 255 B 255.

When converted this will be R 0x7c00 B 0x03E0 B 0x7FFF and when these are OR together the transparency colour required is 0x7FFF.