Save Image to .tga

Blitz3D Forums/Blitz3D Programming/Save Image to .tga

_PJ_(Posted 2005) [#1]
I was wondering if anyone knows if this is possible (well, of course it should be, but y'know...)

Perhaps a dll is needed? I dont understand enough about file-headers and the information stored in files to know where to start, but I would really really like to have a function that can replace the SaveImage command with something that saves as a .tga file (Compression is NOT necessary!) can anyone offer any help?

The reason?

Well I have written a simple Portrait converter for NWN. Basically, it takes any Bitmap or J-PEG or PNG image placed in the 'Images' folder, and creates the required scaled versions with cropped areas where necessary and exports these to another folder.

However, NWN only accepts .tga uncompressed files, so my utility is pretty useless until I can save that format within Blitz...

(This is B3d, not B+)


Who was John Galt?(Posted 2005) [#2]
There is a function in the code archives that does what u want.


TeraBit(Posted 2005) [#3]
Probably this one in fact..

http://www.blitzmax.com/codearcs/codearcs.php?code=1247


big10p(Posted 2005) [#4]
I'm using the FreeImage DLL with a cut-down version of Snarty's blitz3D wrapper code. It allows me to load and save images in PNG,BMP,TGA,TIF and JPG - 24bit only, though. Do a google search to find them both.


_PJ_(Posted 2005) [#5]
Sorry took a while to get back to yas, but thanks loads. skidracer's little function was perfect for what I needed (credit is given within the program!) I assume most images people will want to use will be JPGs or BMPs really.

Anyway, the application/utility thing works a treat and if any of you here play NwN and wish to make use of the program, I am awaiting its authorisation from ign, as soon as I get the okay, Il post a link!