PDA

View Full Version : How to do headers


Dawgster
22nd October 2004, 07:39
After you create .h files with Image2Hack.exe program by morgan.

You have to keep the old .h file. But you to rename it into something. Add 2 at the end of the name. For example, we're changing evillogo.png and try to convert it into .h

Tutorial for evillogo.png (Same as others)

Rename evillogo.h to evillogo2.h

Open command prompt and go to your evilhack artwork folder.

Type "image2evilhack.exe evillogo.png evillogo.h"
----Without the " "--------

Open evillogo.h and evillogo2.h

On Evillogo.h

Find:

unsigned char VariableName[ size of image file] = {


I'm not going to bother explain VariableName. But you have to change VariableName and size of image file.

Open EvilLogo2.h

Find:

unsigned char LogoTexData[xxxxxx] = {


LogoTexData is what you have to copy and xxxxx is just a number, ignore it.

On EvilLogo.h


unsigned char VariableName[ size of image file] = {


Replace it to


unsigned char LogoTexData[ size of image file] = {


As for the size of the image file. Right click on evillogo.png and Click on properties.

Look for Size on Disk:

Lets say the size is 72 kb.

Size of image file has to be in bytes.

1 KB = 1024 bytes

So 72*1024=73728

Then all you have to do is,


unsigned char LogoTexData[ size of image file] = {


Replace it to

unsigned char LogoTexData[73728] = {




It works same on other .h converted files from images. Then compile it and enjoy your new image.

megawhey
22nd October 2004, 08:52
umm.. isnt this already in the readme file that comes with image2evilhack.exe?

also.. for a quick reference...

RightClick on the picture, select properties.. and look at the size of the image in KB and Bytes= much easier

OMFS
22nd October 2004, 09:06
The easier way is to make the blank header file the same name as the png file as above, drag them both onto the image2evilhack icon and bingo it is done. Then add in the command and file size.