• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

View MPQ with VB

Status
Not open for further replies.
Hello people =P
Sorry if it's not the right place

Could anyone tell me (or just give some hint) how to view images from an MPQ, using VB 6?
I have all the functions to open/close archives/files and to read files, but I still don't know how to show images like Warcraft III Image Extractor does. I don't even need to extract it.

Also, I'd be glad if someone could tell me how to use C++ programs with VB, too. Let's say I want to make an interface for it xD

Thanks in advance!
Hossomi-sama
 
Level 6
Joined
Aug 15, 2007
Messages
209
Ohsnap, you mean Visual Basic? I'm thinking you might need something like an "adapter" since TGA files are rather uncommon. Look in tools section for Biturn. This program may help.
Though it may not, and I may have no idea what I'm talking about.
Good luck! *runs away*
 
Level 15
Joined
Jun 28, 2007
Messages
1,424
I think Biturn won't help me... I want to make a program that can view MPQ images, not convert files =P
Storm.dll has all the functions but I have to know them, so I can use it in VB.
Maybe I'll need to convert them to JPG but then it's another story xD

I know it's possible and I'm curious enough to find out hehehehehe xD

Thanks!

there is a vista api that can do that
 
Level 15
Joined
Nov 1, 2004
Messages
1,058
Hello people =P
Sorry if it's not the right place

Could anyone tell me (or just give some hint) how to view images from an MPQ, using VB 6?
I have all the functions to open/close archives/files and to read files, but I still don't know how to show images like Warcraft III Image Extractor does. I don't even need to extract it.

Also, I'd be glad if someone could tell me how to use C++ programs with VB, too. Let's say I want to make an interface for it xD

Thanks in advance!
Hossomi-sama
You should be able to use ShadowFlare's SFmpqapi with your vb 6 project.
Get it here:
http://shadowflare.samods.org/dwnload.html
You can use standard DLLs with Visual Basic. Just use a "Declare Function" to specify which calls you want to use (the ShadowFlare zip file should contain a skeleton vb project with all the DLL functions declared).

As for BLP conversion, you can use the Intel JPEG library DLL bundled with Warcraft 3 (in the Warcraft3 directory, it's called ijl15.dll). You will need to parse the BLP header, but it's extremely straightforward: basically a JPEG file with a fixed amount of BLP header data inserted near the beginning.

Here's a description (from some forums online) of the BLP header:
The BLP file contain the JPEG header and the JPEG raw data separated.
BLP stands for "Blip" file which I guess is a "BLIzzard Picture".
Header:
char[4]: file ID ("BLP1")
int: unknown
int: unknown
int: image width
int: image height
int: unknown
int: unknown
int: data offset (from the begining of the file)
int[15]: unknown
int: header size "h" (usually 0x00000270)
byte[h]: header
followed by 0 bytes until the begining of the jpeg data.
address=data offset: raw jpeg data till the end of the file
Note by Samuraid: The padding between the header and JPEG data is not always null bytes. I have seem some files that have random garbage inserted as padding, or no padding at all.

That said, if you are not familiar with working with file formats, this won't be very easy to do, but if you are up to the challenge it's a lot of fun when it's all figured out.
 
Status
Not open for further replies.
Top