Have an AutoHotkey GUI that uses images and you want to imbed those images INTO your script code? (and not have to use a path to an image file?)
The script will convert your image files into autohotkey data that can exist in your AHK script.
1> Download this conversion tool
computoredge.com/AutoHotkey/Downloads/Image2Include.ahk
2> Run the tool
(This example an image called "colors.png", which is a TV style color bar pattern, is used)
3> Click the CONVERT IMAGE button
Script shows a "successfully created!" at the bottom
4> Click on "SHOW SCRIPT"
You'll see something like this. Not the first portion "Create_colors_png". That is the name that you use in your code for the image name.
5> COPY all of the code and PASTE it somewhere in your script.
6> If you have some gui code already that is loading a picture, you just replace the dir/image name with the following code syntax.
% "HBITMAP:*" . Create_colors_png()
(NOTE! You need to have the double parathesis at the end! don't forget those)
Here's a quick example GUI that will show the image, in my example, a color bar pattern
gui, add, Picture, , % "HBITMAP:*" . Create_colors_png()
Gui, Show
msgbox press key to continue
; # This #Include file was generated by Image2Include.ahk, you must not change it!
; ############################################################
Create_colors_png(NewHandle := False) {
Static hBitmap := 0
...rest of code copy/pasted from the conversion script
And if you run it, will look like this:
If you have suggestions of how to improve it, let me know in the comments! Thanks!