Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > AutoIt
You last visited: Today at 16:06

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[Switch]Images

Discussion on [Switch]Images within the AutoIt forum part of the Coders Den category.

Reply
 
Old   #1
 
xKemya's Avatar
 
elite*gold: 0
Join Date: Jan 2013
Posts: 2,450
Received Thanks: 1,880
[Switch]Images

Hello,

so I've created a new project, I want to know how to when I click on a picture it switch to another picture?

I mean : I made a picture for the check box which is unchecked, I want to make a function that when I press on the picture it make it checked.
xKemya is offline  
Old 02/13/2014, 19:16   #2
 
alpines's Avatar
 
elite*gold: 60
Join Date: Aug 2009
Posts: 2,256
Received Thanks: 815
Just replace the GUICtrlCreateButton with GUICtrlCreatePic
Code:
$h = GUICreate("", 100, 100)
$b1 = GUICtrlCreateButton("checked", 0, 0)
$b2 = GUICtrlCreateButton("unchecked", 0, 25)
$c = GUICtrlCreateCheckbox("sample", 0, 50)
GUISetState()

While 1
	Switch GUIGetMsg()
		Case -3
			Exit

		Case $b1
			GUICtrlSetState($c, 1)

		Case $b2
			GUICtrlSetState($c, 4)
	EndSwitch
WEnd
alpines is offline  
Old 02/14/2014, 08:34   #3
 
xKemya's Avatar
 
elite*gold: 0
Join Date: Jan 2013
Posts: 2,450
Received Thanks: 1,880
Quote:
Originally Posted by alpines View Post
Just replace the GUICtrlCreateButton with GUICtrlCreatePic
Code:
$h = GUICreate("", 100, 100)
$b1 = GUICtrlCreateButton("checked", 0, 0)
$b2 = GUICtrlCreateButton("unchecked", 0, 25)
$c = GUICtrlCreateCheckbox("sample", 0, 50)
GUISetState()

While 1
	Switch GUIGetMsg()
		Case -3
			Exit

		Case $b1
			GUICtrlSetState($c, 1)

		Case $b2
			GUICtrlSetState($c, 4)
	EndSwitch
WEnd
But the 2 pictures are in the same position, will this work with it?

Testing...


More explanation : I've made a squared small picture, added beside it a label called for E.X : Hit Range, I want when I press on the picture, it automatically changes to another picture which in the same position.

If you do not understand I can add pictures.
xKemya is offline  
Old 02/14/2014, 12:59   #4

 
.yorliK's Avatar
 
elite*gold: 0
Join Date: Nov 2011
Posts: 1,448
Received Thanks: 1,257
Quote:
Originally Posted by "V" View Post
But the 2 pictures are in the same position, will this work with it?

Testing...


More explanation : I've made a squared small picture, added beside it a label called for E.X : Hit Range, I want when I press on the picture, it automatically changes to another picture which in the same position.

If you do not understand I can add pictures.
PHP Code:
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 GUICreate("Form1"397141308262)
$Pic1 GUICtrlCreatePic("filepathpicture1"3224233105)
$Checkbox1 GUICtrlCreateCheckbox("Checkbox1"280569717)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg 
GUIGetMsg()
    Switch 
$nMsg
        
Case $GUI_EVENT_CLOSE
            
Exit
        Case 
$Pic1
            
If GUICtrlRead($Checkbox1) == $GUI_CHECKED Then
                GUICtrlSetImage
($Pic1"filepathpicture1")
                
GuiCtrlSetState($Checkbox1$GUI_UNCHECKED)
            Else
                
GUICtrlSetImage($Pic1, @ScriptDir "filepathpictur2")
                
GuiCtrlSetState($Checkbox1$GUI_CHECKED)
            EndIf

    EndSwitch
WEnd 
Something like that?
.yorliK is offline  
Old 02/15/2014, 12:02   #5
 
xKemya's Avatar
 
elite*gold: 0
Join Date: Jan 2013
Posts: 2,450
Received Thanks: 1,880
Quote:
Originally Posted by Kilroy. View Post
<.<, see :
I want when I press on the Red Squared pic down :



Turns into this :



So it looks like a checkbox but in real it is Pic and switched to other pic
xKemya is offline  
Old 02/15/2014, 14:34   #6

 
.yorliK's Avatar
 
elite*gold: 0
Join Date: Nov 2011
Posts: 1,448
Received Thanks: 1,257
Quote:
Originally Posted by "V" View Post
<.<, see :
I want when I press on the Red Squared pic down :
Than do this:
PHP Code:
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 GUICreate("Form1"397141308262)
$Pic1 GUICtrlCreatePic(@ScriptDir '\img_black.jpg'3224233105)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

Dim $Pic_check 0
While 1
    $nMsg 
GUIGetMsg()
    Switch 
$nMsg
        
Case $GUI_EVENT_CLOSE
            
Exit
        Case 
$Pic1
            
If $Pic_check 1 Then
                GUICtrlSetImage
($Pic1, @ScriptDir '\img_black.jpg')
                
$Pic_check 0
            
Else
                
GUICtrlSetImage($Pic1, @ScriptDir '\img_white.jpg')
                
$Pic_check 1
            
EndIf

    EndSwitch
WEnd 
You only have to change, the koords and pathes.
If you need help, send me your code via pn
.yorliK is offline  
Thanks
1 User
Reply


Similar Threads Similar Threads
Metin2 png images pack 300+ images
11/15/2014 - Metin2 PServer Guides & Strategies - 9 Replies
Hi, here is 300 piece png images pack, it is mobs, npc, character weapons, house and more images :) Link to download: https://www.rapidshare.com/#!download|306|19862143 22|CirilGyujtemeny.rar|63099 Please take thanks for upload. Password for extract: ciril
[Selling] 24 Port Switch - 3Com Switch 3300 24 Port
05/13/2013 - Trading - 4 Replies
Hallo zusammen, hier biete ich einen Switch der Firma 3 Com an. Model 3C16406 24 Port / SuperStack II Technisch Daten sind hier zu umfangreich Bitte aus dem Netz laden .
I need to Switch Item Images.
10/17/2008 - Conquer Online 2 - 0 Replies
I have seen the previous article about stanchers into dbs as a scam. Not interested in scamming anyone.. Tried to locate the files but believe that since that post files have changed and have not been able to locate the images anywhere. Goal here is this. I want to turn the image of Moss / DreamGrass / Aroma into another image perferably meteors as my bot already picks up mets on its own. Client sided not server sided I am aware of this and again... NOT interested in scamming just botting 2nd...



All times are GMT +1. The time now is 16:07.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.