Jump to content

Background Image


Recommended Posts

I'm sorry if I don't use the right terminology but what I'm looking to do is create a GUI with a background image. I made one and it runs fine on my computer when I don't move the .exe file from my desktop, with the "img/bg.jpg" on the desktop. But when I try to send the .exe to my friend, or even move it the "img" folder it loses the "bg.jpg", how do I make it so I don't need to send folder with the .exe file? If this was explained in the AutoIt help just tell me what section it is in and I will go look for it, or if there is a post where this has been answered could somebody link me?

This is what I have as far as coding for the GUI

FUNC _clientscreen()
    Local $ZKLJHhl234qq, $GUImsg    
    GUICreate("FPSClient Screen", $ScreenWidth, $ScreenHeight, 0, 0, 0x80000000, 136)
    GUISetBkColor(0x000000)
    GUICtrlCreatePic("img/bg.jpg", 0, 0, $ScreenWidth, $ScreenHeight)
    GUISetState()
    While 1
    $GUImsg = GUIGetMsg()     
    If $GUImsg = $GUI_EVENT_CLOSE Then ExitLoop
    WEnd
    GUIDelete()
ENDFUNC

Thank you in advance for any and all help :P

Link to comment
Share on other sites

  • Moderators

CaffeineMachine,

2 options:

1. Look at FileInstall in the Help file. This will let you put a copy of the .jpg in your compiled file which you can extract (to @TempDir is a good idea) and then display (not forgetting to delete it when you are done).

2. Look at Zedna's Resources UDF which you can find here. This lets you put the .jpg into your compiled .exe and then use it directly. I cannot recommend this UDF highly enough - but you do need to read through the thread and understand it properly before you can get the best from it.

My choice: Zedna every time - but FileInstall is probably easier to get your head around.

Over to you.

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...