Hest Posted September 28, 2009 Share Posted September 28, 2009 (edited) Im having some problems putting a bmp image inside a compiled script. Or it's not a problem getting it in, it's more getting it out again without using fileinstall. I have tried Zedna's UDF from here http://www.autoitscript.com/forum/index.php?showtopic=51103 but I cang get it to work. I have this code in the beginning of my script expandcollapse popup#Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_UseUpx=n #AutoIt3Wrapper_Res_File_Add=bg.bmp, bitmap, BMP #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #include <GUIConstantsEx.au3> #include <GuiStatusBar.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <String.au3> #include "resources.au3" Global Const $SF_UTF8 = 4 Global Const $SF_ANSI = 1 Global $xmlfile = @ScriptDir & "\feed.xml" If NOT FileExists($xmlfile) Then InetGet("http://www.vivaldi.dk/feed/news/all/", $xmlfile, 1, 0) If @error <> 0 OR @InetGetBytesRead < 1024 Then Msgbox(0,"Error", "There was an error while downloading the feed. Check your Internet connection and try again!") FileDelete($xmlfile) Exit EndIf EndIf Global $Softwarename = "Name" Global $Softwareversion = 1.00 Global $Title[6] Global $Link[6] Global $Text[6] Global $Date[6] Global $ColorLabel[6] Global $Goto[7] Global $Timer = TimerInit() Global $Updatetimer = 600000 Global $Firstupdate = 540000 Global $Titel_Color = "0X8EA2CC" ; 778EBD 0XA20000 8EA2CC Global $Text_Color = "0XEFEFEF" #Region ### START Koda GUI section ### Form= $Maingui = GUICreate($Softwarename, 488, 472, 193, 124) $bg = GUICtrlCreatePic("bg.bmp", 0, 0, 488, 452) GUICtrlSetState (-1, $GUI_DISABLE) My background is called bg.bmp as you can see in the GUICtrlCreatePic. Can anyone help me how to add and extract that .bmp "inside" the exe Edited September 29, 2009 by Hest Software:Model Train Calculator (Screen)Autoit3 beginner! Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted September 28, 2009 Moderators Share Posted September 28, 2009 Hest,You really do need to read through the topic carefully and play with the examples before using Zedna's excellent UDF.The #AutoIt3Wrapper_Res_File_Add directive no longer works with this UDF -(that is why it is struck out on the first page of the topic!). If you read the thread you will find out why. You should use ResHacker instead.Also, if you had played with the examples you would have seen that you need to use a function from within the UDF to get the BMP into the picture control.So, download ResHacker and change your directive to read:#AutoIt3Wrapper_Run_After=Full_Path\ResHacker.exe -add %out%, %out%, bg.bmp, bitmap, BMP, 0Then change the picture control generation code to read:$bg = GUICtrlCreatePic("", 0, 0, 488, 452) _ResourceSetImageToCtrl($bg, "BMP", $RT_BITMAP) GUICtrlSetState ($bg, $GUI_DISABLE)Zedna's UDF is an awesome piece of work - but as I said above, you really do need to read the whole topic and try out the examples before trying to use it for real.Anyway - the code above works for me - come back if you still have problems. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Hest Posted September 29, 2009 Author Share Posted September 29, 2009 Thx alot, that helped. Didn't really think about the #AutoIt3Wrapper_Res_File_Add being struck out, but it's working now. Software:Model Train Calculator (Screen)Autoit3 beginner! Link to comment Share on other sites More sharing options...
Zedna Posted September 29, 2009 Share Posted September 29, 2009 (edited) Thx alot, that helped. Didn't really think about the #AutoIt3Wrapper_Res_File_Add being struck out, but it's working now.I will remove it definitely from my post :-)I used it but later Autoit3Wrapper was changed and #AutoIt3Wrapper_Res_File_Add stopped working because it places resources to wrong section with wrong nameso I reverted back to using reshacker.exe for adding resources. Edited September 29, 2009 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