CodeMaster Rapture Posted April 28, 2006 Share Posted April 28, 2006 I thought I saw a thread on here about it before, but I can't find it. Basically I'd like to imbed a jpeg I'm using for the GUI background into the exe itself to make it looks more... professional. I know it is possible to do in C++, but it isn't possible to rewrite my script in C++ due to the dynamic variable usage. Any ideas/suggestions? Thanx, -CMR Link to comment Share on other sites More sharing options...
Xenobiologist Posted April 28, 2006 Share Posted April 28, 2006 I thought I saw a thread on here about it before, but I can't find it. Basically I'd like to imbed a jpeg I'm using for the GUI background into the exe itself to make it looks more... professional. I know it is possible to do in C++, but it isn't possible to rewrite my script in C++ due to the dynamic variable usage.Any ideas/suggestions?Thanx,-CMRHi,what about FileInstall it first before using?So long,Mega Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
CodeMaster Rapture Posted April 28, 2006 Author Share Posted April 28, 2006 I'd prefer to have the file imbeded, but if it isn't possible, then so be it. I'd just prefer to have my logo imbedded is all. -CMR Link to comment Share on other sites More sharing options...
Xenobiologist Posted April 28, 2006 Share Posted April 28, 2006 I'd prefer to have the file imbeded, but if it isn't possible, then so be it. I'd just prefer to have my logo imbedded is all.-CMRHI,hmmh I don't think that is possible, but you can install it via FileInstall with the hidden attribute and when closing you delete it. Not that what you wanted, but nearby I guess. So long,Mega Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
Zedna Posted April 28, 2006 Share Posted April 28, 2006 I thought I saw a thread on here about it before, but I can't find it. Basically I'd like to imbed a jpeg I'm using for the GUI background into the exe itself to make it looks more... professional. I know it is possible to do in C++, but it isn't possible to rewrite my script in C++ due to the dynamic variable usage.Any ideas/suggestions?Thanx,-CMRIt's possible and not so much complicated I use it in my project for icons for ListView items but it can be whatever you want (embeded as resource in EXE and simply directly used in script).Look here at my post Adding "resources" to a compiled script, Better than FileInstall for icons, etc Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
CodeMaster Rapture Posted April 29, 2006 Author Share Posted April 29, 2006 It's possible and not so much complicated I use it in my project for icons for ListView items but it can be whatever you want (embeded as resource in EXE and simply directly used in script). Look here at my post Adding "resources" to a compiled script, Better than FileInstall for icons, etc Ok, I'm glad it is possible. Can you possibly give a step-by-step method of imbedding: C:\Documents and Settings\All Users\Documents\My Pictures\Sample Pictures\Sunset.jpg Into a simple script: #include <GUIConstants.au3> HotKeySet("{ESC}","Quit") $GUI = GUICreate("Sunset",800,600,0,0,$WS_POPUP,$WS_EX_TOPMOST) $Pic = GUICreate("Sunset.jpg",0,0,800,600) GUISetState(@SW_SHOW,$GUI) While 1 Sleep(100) WEnd Func Quit() Exit EndFunc I am asking for step-by-step directions for my own ignorance and for those who come across this thread in the future. Thanx, CMR Link to comment Share on other sites More sharing options...
Zedna Posted April 29, 2006 Share Posted April 29, 2006 Ok, I'm glad it is possible. Can you possibly give a step-by-step method of imbedding:Into a simple script:I am asking for step-by-step directions for my own ignorance and for those who come across this thread in the future.Thanx,CMRMy example is for icons, for JPEG has to be used some other resource type (I don't know which, maybe some of standard types or new one or generic DATA) and probably can't be used directly by GUICtrlSetImage() as for icons to use resource within the script.Probably there must be used some of API calls to for resources like FindResource, LoadResource, ...It's described at MSDN: Introduction to Resources Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
CodeMaster Rapture Posted April 29, 2006 Author Share Posted April 29, 2006 I've made some progress, I've got the logo imbedded. Now to figure out how to access it... When I extract all the resources from my new exe, the logo is there (as a bitmap) named "Bitmap_1.bmp", but I cannot access it directly in the script. Now, I would try a DLL Call for LoadBitmap() or LoadImage() in User32.dll, but I'm not sure exactly how to go about it, muchless know if it would work :/ Guess I'll keep trying or just save myself some hassle and rewrite this in C++... somehow.. -CMR Link to comment Share on other sites More sharing options...
Zedna Posted April 30, 2006 Share Posted April 30, 2006 (edited) I've made some progress, I've got the logo imbedded. Now to figure out how to access it...When I extract all the resources from my new exe, the logo is there (as a bitmap) named "Bitmap_1.bmp", but I cannot access it directly in the script. Now, I would try a DLL Call for LoadBitmap() or LoadImage() in User32.dll, but I'm not sure exactly how to go about it, muchless know if it would work :/Guess I'll keep trying or just save myself some hassle and rewrite this in C++... somehow..-CMRI searched in forum for LoadBitmap and LoadImage and there is lot of stuff to use Look for example here: Larry's exampleIt's exactly what we need, only at LoadImage() use LR_LOADFROMRESOURCE instead of LR_LOADFROMFILE.So princip: Place Picture control on your GUI and this example will draw bitmap obtained by LoadImage on that Picture control.EDIT: another related great post from Larry Pixel Color in BMP file Edited April 30, 2006 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
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