Jump to content
Sign in to follow this  

Adding pictures, file directories

Recommended Posts

hey peoples,

I am new autoit and i have made a script it all works,

Its just there is one thing i would like to change.

were i have added my pictures in i have used this:

$hPic_background = GUICtrlCreatePic("C:UsersPhaisiusDesktopJaguar.jpg")

My question is what code can i use to make it so the picture is getting loaded from the directory

of the script so i can put the scipt in a folder and the pictures in a folder in the folder of the script

That way i can move the folder and it would still work.

Anyone understand were i am coming from?

like i said i am learning help would be awsome



Share this post

Link to post
Share on other sites

i am getting errors in this line i dont think i am putting it in correctly,

When you say Workingdir do i have to put the name of the folder that the script is in?

$hPic_background = GUICtrlCreatePic(@WorkingDir & "ImagesJaquar.jpg"

Thats how i have put it in is that what do you reckon i have done wrong?

Share this post

Link to post
Share on other sites

@WorkingDir is the working directory, not necessarily the directory where the script is located. for the script directory use @ScriptDir

in AutoIt, @ is the prefix for an element called "Macro". search the help file for various macros available.

Share this post

Link to post
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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...