Sign in to follow this  
Followers 0
DarkBoost

_GUIImageList_AddBitmap()

5 posts in this topic

#1 ·  Posted (edited)

Hi I have used the following command _GUIImageList_AddBitmap and added a macro @tempdir and found it will not pickup the image, however if I add a variable or direct path it works fine. I tested with @desktopdir with same results, so it appears to be with macro's not @tempdir specifically. Anyone else ran into this?

Edited by DarkBoost

Share this post


Link to post
Share on other sites



;WORKS

$file = "c:\image.bmp"

$button = GUICtrlCreateButton("",60,130,88,68)

$image = _GUIImageList_Create(80,60,5,1)

_GUIImageList_AddBitmap($image,$file)

_GUICtrlButton_SetImageList($button,$image)

;FAILS

$file = @TempDir & "\image.bmp"

$button = GUICtrlCreateButton("",60,130,88,68)

$image = _GUIImageList_Create(80,60,5,1)

_GUIImageList_AddBitmap($image,$file)

_GUICtrlButton_SetImageList($button,$image)

Share this post


Link to post
Share on other sites

Try

$file = FileGetShortName(@TempDir & "\image.bmp")
Yeah tried that before posting :)

I restarted AutoIT and it started working!? ... weird

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  
Followers 0