Saving AGFImage to targa?

Started by
3 comments, last by AvatarXY 21 years, 1 month ago
Hey, Is there an easy way to save an AGFImage back to a tga file? I see the SaveToVTDb, and that the vtdmanager can extract back to bmp, jpg, etc., but is there a way to save directly to a .tga, or is this something I'd have to code myself? Thanks, Jason Morrison p.s: PowerDraw, Lifepower, and this forum all rock! So helpful! [edited by - AvatarXY on March 6, 2003 1:01:33 AM]
Advertisement
You can use the GraphicEx library to save as targa (it can also read that and many other formats). TTargaGraphic is a descendant of TBitmap, so there is probably an easy way to copy the pixel data to it from a TAGFImage.
[ PGD - The Home of Pascal Game Development! ] [ Help GameDev.net fight cancer ]
The method mentioned by Useless Hacker, can be also implemented by using PowerDraw''s library - TGAReader and then declaring bitmap as TBitmapEx, which is the same as TBitmap, just can read and write to TGA file.
I haven''t implemented SaveToFile method in TAGFImage because I thought it wasn''t of any use. What do you need it for?
Thanks for the suggestions, I had been using GraphicEx a while ago and forgotten about it =)

I''m writing a utility to make tile libraries for a map editor (next step of the project) and am having the user add tga files dropped from an explorer window, rearranging the frames of animation, etc., and then saving the tile library as an xml file detailing the animation frames and default tile properties (walkable, etc.) and a tga file that holds all of the frames ready to be loaded into 256x256 textures, so my AGF loading/blitting/saving is for this. It might seem a little overkill to use PowerDraw for this util, but I''m getting the practice in for the map editor and possibly game client. So far, it''s working out great!
As far as I get free, I''ll be finishing PowerDraw 3.0 and implementing any add-ons suggested. Please, if it''s not too much trouble, can you e-mail me whatever you think could be useful, ''cause I''ll be creating a to-do list and it''s hard to keep track of messages on forums.

- Lifepower

This topic is closed to new replies.

Advertisement