Browse forums 
Ankama Trackers

C# - How to get TGA image from JAR file through code

By Growlurg - MEMBER - October 14, 2019, 11:04:53

Im trying to make "offline" builder for Wakfu in c# wpf. Im not a programmer.

I need to get a picture from JAR file and apply that picture to an Image control.

I dont need to extract file. I need program to just load picture from archive.

Example of the path to the image in archive "gui.jar\icons\items\64\1202021.tga"

For now i have to manualy extract item images and convert them into the png to display them. 

Please help. Thank you.

Im doing it so builder just need json files to always be up to date.

0 0
Reactions 1
Score : 869

C# doesnt nativly handle ZIP files (well, it does, but it's a long story), JAR is just a Deflate32 ZIP file. You'll have to use a library that navigates archives and allows you to decompress them into a memory area, from which your app can then read the TGA image. Some popular libraries are: zlib (C, you'll have to write your own C# wrapper), DotNetZip , SharpZipLib or if you're using .Net 4.5 or newer you might try the built-in ZipArchive.

1 0
Respond to this thread