dar100111 Posted February 20, 2014 Posted February 20, 2014 Hey Everyone! Is it possible to compile a JPEG picture that I'm using into the exe so the file doesn't have to be installed on the users computer to show up? Thanks! $Form1 = GUICreate("Ft. Worth Cats Database", 442, 360, 279, 238) $Pic1 = GUICtrlCreatePic("cats_logo.jpg", 100, 0, 255, 198)
UEZ Posted February 20, 2014 Posted February 20, 2014 Yes, it is possible. There are two ways, 1st is to use resources and the 2nd way is to convert the image into a binary string and use it directly from memory.Br,UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ
dar100111 Posted February 20, 2014 Author Posted February 20, 2014 Hey UEZ, This seemed to do the trick. Thank you very much! If Not FileExists(@ScriptDir & "\images\cats_logo.jpg") Then DirCreate(@ScriptDir & "\images") FileInstall("C:\Users\dfw-danielro\Desktop\CATS_DB\cats_logo.jpg", @ScriptDir & "\images\cats_logo.jpg")
UEZ Posted February 20, 2014 Posted February 20, 2014 (edited) Well, your answer is not the solution to your question how to use an image whereas "the file doesn't have to be installed on the users computer". Have a look to >Resources UDF or to >File to Base64 String Code Generator. Br, UEZ Edited February 20, 2014 by UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ
dar100111 Posted February 20, 2014 Author Posted February 20, 2014 Ah I see what you mean by resources now UEZ. I didn't realize it was another set of UDF's I had to install. I will check that out. I didn't realize how easy it was to do the solution above and that it could just re-create the directory above, even if it wasn't on the users computer, or was deleted. I didn't realize that would keep the picture in the compiled version so I just used that instead. Seems like the binary solution might be the most effective, I just need to play around with it. Thanks for the links to the UDF!
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now