Jochen,
Have fun 
my reference is
that.
Whether it's worthwhile is another question:
1. a medium-sized tga image is 20x the size of its jpg representation
2. converters tga->gif or jpg exist; even the old 1996 Paintshop 4.1 can do it, in batch mode
Things are not so easy. Our fractal image compression software uses the TGA format for historical reasons. The encoder reads a TGA file and compresses it. I left out a lot of steps, but it's just the principle.
The decoder reads the compressed file, decodes it and writes back a TGA file. This can be viewed with various image viewers or image processing programs: Photoshop, Gimp, IrfanView... you name it.
We need lossless data, of course, which TGA provides; JPG is already lossy due to quantization.
In some cases it would be quite comfortable to see the result of the decoder directly without having to use additional software. But before I change everything in the encoder, decoder, filters (low pass, high pass, median),
and edge detectors, I have to try if my idea is feasible. I plan to proceed like this:
- Determine the size of the TGA file.
- Request enough memory for double buffer.
- Read the TGA header.
- Write a corresponding BITMAPFILEHEADER and BITMAPINFOHEADER in the memory.
- Copy the image data behind the new headers.
This should work, because the image data is the same for BMP and TGA: First comes the last line, then the second to last line, ... at the end then the first line.
Since we work with 24 bit color depth, the color order is also the same: Blue, Green, Red one byte each. I think MS kept a sharp eye on the TGA format when developing the BMP format.
The question now is: Is it possible to tell via GDI or GDI+ that there is a BMP file to display at the memory address?
Gunther