To use the class, simply include it on your PHP file:
include('class.ebm2bmp.php');
Then, instantiate the class:
$emblem = new EBM2BMP($path); // where $path is the physical location of the emblem files
$emblem->processFile($file); // where $file is the emblem file to convert into BMP
If you want to replace the magenta color (transparent in-game) for display in web pages, you can use the replace function:
$emblem->replaceColor('FF00FF', 'C0C0C0'); // this will change magenta into silver
Now you can choose what to do with the processed files.
You can display the actual converted BMP image:
// $emblem->showBMP();
Or, display the BMP as tables to make it appear big:
// $emblem->showBigImage();
Or even display the BMP information as an array:
// $emblem->showArray();
You can choose only 1 from the 3 output methods.
Have fun!
|