Jump to content
Sign in to follow this  
Phaisius

Adding pictures, file directories

Recommended Posts

Phaisius

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

Thanks,

PhaiSiuS

Share this post


Link to post
Share on other sites
Driveskull

(@WorkingDir & "Images5.png"

Use it like this, when you move a script with a image folder it will always use it

Share this post


Link to post
Share on other sites
Phaisius

Awsome Thanks heeps mate

Share this post


Link to post
Share on other sites
Phaisius

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
orbs

@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
Phaisius

ok Thank you for your help

I got it working

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  

×