Logo Tools - Convert Bitmaps to MXS / by David Mackenzie

Maxscript_Image
Logo Tools v1.00
Logo Tools v1.00

Here is a script designed for other script writers. Anyone who has spent some time creating custom images for their scripts and tools know how much of a pain it can be wrapping them for distribution. Logo Tools is designed to make that a little bit easier. It allows you to pick an image and then convert it to a maxscript array so you can embed your bitmap into your script. All of the functions and code required to convert your maxscript array back into a bitmap are included.

This is a very easy, neat and tidy way to package your scripts up. I normally include the code in a install script that writes all of the bitmaps to disk so they can be used again later. If anything ever happens to those images your script has the code to recreate them on the fly.

Logo Tools is very easy to use, just follow the steps below:

  1. Pick an image file that you would like to convert. Do this by clicking the "+" button.
  2. Now pick the file to output again by clicking the "+" button. This file will contain the array representing the bitmap and a code required to convert the array back to a bitmap.
  3. You can now hit the "Make It So" button to get the ball rolling. The progress bars will continue to update until complete.
  4. You can now open the outputted script file which will have the array and a function to create the bitmap already in it.

If you run into any trouble or have any ideas on how I could improve this script please let me know. Feel free to leave a comment below.

To download Logo Tools just click here.

Remember the bigger the image you select the longer it will take and the larger the resulting script file will be.  This script is really designed to handle small logos and button icons that would be added to custom tools. Running the script on a large image will take a long time and the script file will be huge!

I have been asked for an example on how to integrate the images into a GUI control. Below you can download the source for my script (I think some people thing I did not write it??) along with a small example showing how to add an image to a button. I should also mention that the max script help file has excellent resources for working with images and UI controls.

To download Logo Tools source and demo click the link below.

{filelink=5}