Sign in to follow this  
Followers 0
locutus243

Attaching pictures to buttons problem

8 posts in this topic

Hey all,

I've come across a simple but puzzling problem when trying to attach a picture to a button. I wondered if anybody else had experienced the problem or if anyone knew possible solutions???

I create a button with a picture on and whenever the GUI runs it shows the button but without a picture. I've even tried making it through KODA FormDesigner and this does the same, the button appears but the picture thats suppose to be on it doesn't. Wondered if anybody had any suggestions???

I've included the code generated from KODA to show what I'm trying to do and perhaps where I'm going wrong.

#include <GUIConstants.au3>
;Generated with Form Designer preview
$Form1 = GUICreate("AForm1", 632, 448, 192, 113)
$Button1 = GUICtrlCreateButton("(Not allowed)", 88, 88, 414, 202, $BS_BITMAP)
GUICtrlSetImage($Button1, "J:\MERHCNTL\EK Rechner\Mark\Pictures\Log.jpeg")
GUISetState(@SW_SHOW)
While 1
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
    Case Else
    ;;;;;;;
    EndSelect
WEnd
Exit

Share this post


Link to post
Share on other sites



Hey,

Thanks for the suggestion. I tried converting it to a bitmap but KODA won't even accept this as a valid picture format. And without using KODA it still doesn't seem to work???

Mark

Share this post


Link to post
Share on other sites

Hey guys,

I was also working with some icons, trying to add an icon to buttons etc... or even to my Main GUI. When the source of my icon is an .exe file such as 'GuiSetIcon(@SystemDir & "\mspaint.exe", 0)' then it works fine, but otherwise it doesn't seem to work.

I have a folder with a load of .gif files in that I want to use as icons but I don't know why it won't work and can't seem to make it work.

Any help would be much appreciated (on both problems!!!)

Thanks

Mark

Share this post


Link to post
Share on other sites

Hey,

Thanks for the suggestion. I tried converting it to a bitmap but KODA won't even accept this as a valid picture format. And without using KODA it still doesn't seem to work???

Mark

You'll have to take that up with the KODA devs, don't use that myself.


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

Hey guys,

I was also working with some icons, trying to add an icon to buttons etc... or even to my Main GUI. When the source of my icon is an .exe file such as 'GuiSetIcon(@SystemDir & "\mspaint.exe", 0)' then it works fine, but otherwise it doesn't seem to work.

I have a folder with a load of .gif files in that I want to use as icons but I don't know why it won't work and can't seem to make it work.

Any help would be much appreciated (on both problems!!!)

Thanks

Mark

Far as I know you can't use gif files as icons, you'll either have to use a dll,exe or ico file


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

Hey,

Thanks for that tip. It seems that icons work fine now. Still a little puzzled why pictures won't work. Perhaps its the same problem, although I'm sure that AutoIT claims pictures can be used on buttons and $BS_BITMAP suggests this is the case. When it comes down to it I'm sure its my ignorance rather than AutoIT's inadequecies that are the problem!!!

If anyone has any tips on putting pictures on buttons or even an example then I would appreciate it.

Cheers

Mark

Share this post


Link to post
Share on other sites

@locutus243

I created a button with the BS_BITMAP Style and attached a BMP picture using GUICtrlSetImage()

The code worked without any problems. Try using the latest beta. I seem to remember that some picture display issue was resolved in one of them.

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