MikeP Posted May 11, 2008 Posted May 11, 2008 (edited) Hi.. am I dumb? Is it even possible to skin a button with a picture ? I can't get this to work... anyone could check what's wrong in this please : #include <GUIConstants.au3> Opt("GUIOnEventMode", 1) GUICreate("", 300, 300) GUISetState() GUISetOnEvent($GUI_EVENT_CLOSE, "quit") $bttn = GUICtrlCreateButton("damn", 10, 10, 60, 40) GUICtrlSetImage($bttn, "bttn.png") While 1 Sleep(200) WEnd Func quit() Exit EndFunc Thanks ! (I tried with png..gif..jpg..bmp.. I tried putting the full path.. no result ) Edited May 11, 2008 by MikeP
Moderators SmOke_N Posted May 11, 2008 Moderators Posted May 11, 2008 (edited) Icon or Bitmap. The style must be set to $BS_ICON or $BS_BITMAP respectively. Edit: You may want to look at XSkin in the example forum for "skinning" options. Edited May 11, 2008 by SmOke_N Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
Valuater Posted May 11, 2008 Posted May 11, 2008 Maybe...#include <GUIConstantsEx.au3> Opt("GUIOnEventMode", 1) GUICreate("", 300, 300) GUISetState() GUISetOnEvent($GUI_EVENT_CLOSE, "quit") $bttn = GUICtrlCreatePic("C:\Location to picture.jpg", 10, 10, 60, 40) ;GUICtrlSetImage($bttn, "bttn.png"); use this to change the picture While 1 Sleep(200) WEnd Func quit() Exit EndFunc ;==>quit... and for a set of buttons with skinshttp://www.autoitscript.com/forum/index.ph...st&p=3073808)
MikeP Posted May 11, 2008 Author Posted May 11, 2008 (edited) Yeah ..thanks I just found it too Anyway that's not so bad I asked you since now I'll have a look at XSkin Ty Valuater.. I guess I'll do that since putting a bmp on a button like this doesn't give a good result..I'll rather use a picture as a button good idea Edited May 11, 2008 by MikeP
theguy0000 Posted May 11, 2008 Posted May 11, 2008 (edited) change $bttn = GUICtrlCreateButton("damn", 10, 10, 60, 40) to $bttn = GUICtrlCreateButton("damn", 10, 10, 60, 40, $BS_BITMAP) then use a bmp image. If using the beta version of AutoIt, #include <ButtonConstants.au3> edit: lol way too slow Edited May 11, 2008 by theguy0000 The cake is a lie.www.theguy0000.com is currentlyUP images.theguy0000.com is currentlyUP all other *.theguy0000.com sites are DOWN
Valuater Posted May 11, 2008 Posted May 11, 2008 Yeah ..thanks I just found it tooAnyway that's not so bad I asked you since now I'll have a look at XSkin Ty Valuater.. I guess I'll do that since putting a bmp on a button like this doesn't give a good result..I'll rather use a picture as a button good ideaBe sure to see EzSkin too!( the link above )8)
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now