Update on 2013-06-02:
- Added support for icons; the function will return a HICON handle if required. (THX: tmplinshi)
- Changed include script's and function's name from CreateBitmap_name_ext to Create_name_ext.
Update on 2013-05-18:
- Fixed bug producing invalid function names. All non-word characters (others than "a-z", "A-Z", "0-9", and "_") are stripped from the filename before bulding the script and function name (THX: tmplinshi)
- Changed GUI not allowing free typing of file and folder names any more.
This script is just a simple wrapper for SKAN's How to convert Image data (JPEG/PNG/GIF) to hBITMAP ?. It provides a simple GUI to select images and create #include files for them containing the Base64 encryptet image data and SKAN's code to create a bitmap out of the data.
For an image named Test.jpg the script will be named CreateBitmap_Test_jpg.ahk and will contain just one function called CreateBitmap_Test_jpg(). This function creates the bitmap and returns a HBITMAP handle. By default the bitmap is created only once and subsequent calls will return the same handle. This can be changed by passing True as the optional parameter NewHandle.
The GUI has only one option which you may choose if you want the bitmap to be created at load-time.
I know that several included scripts will contain some redundant code, but I don't care about this waste of memory.
It's a good idea to resize the images to the dimensions you need before you create the #include script. And, don't be sad if you try to use an uncompressed image of 2540x1600 pixels with 32 bit color-depth.
So here it is:
If it has been done before, I actually missed that.