Butonlara Resim Koymak - Çözüldü

Programlama ve Script dilleri konusunda bilgi paylaşım alanıdır.
Cevapla
darendeli
Byte4
Byte4
Mesajlar: 195
Kayıt: 06 Haz 2016, 16:55
Teşekkür etti: 1 kez
Teşekkür edildi: 6 kez

Butonlara Resim Koymak - Çözüldü

Mesaj gönderen darendeli »

Butonlara Resim Koymak istiyorum diyelim facebook amblemini fln koyacam ama olmyor
Kullanıcı avatarı
BlueLife
Kilobyte1
Kilobyte1
Mesajlar: 292
Kayıt: 29 Ağu 2014, 20:42
Teşekkür etti: 45 kez
Teşekkür edildi: 68 kez

Re: Butonlara Resim Koymak

Mesaj gönderen BlueLife »

Butonlara resim degilde icon eklenir genelde. Misal asagıdaki gibi.
Resim

Autoit yardım dosyasında ornekle vardı.

Kod: Tümünü seç

#include <GUIConstantsEx.au3>
#include <ButtonConstants.au3>

Example()

Func Example()
    Local $msg

    GUICreate("My GUI") ; will create a dialog box that when displayed is centered

    GUICtrlCreateButton("my picture button", 10, 20, 40, 40, $BS_ICON)
    GUICtrlSetImage(-1, "shell32.dll", 22)

    GUISetState()

    ; Run the GUI until the dialog is closed
    While 1
        $msg = GUIGetMsg()

        If $msg = $GUI_EVENT_CLOSE Then ExitLoop
    WEnd
EndFunc   ;==>Example
Tabi komple bir buton resmi hazırlaıp bunu calısmanda kullanabilirsin. Misal asagıdaki gibi.
Resim
darendeli
Byte4
Byte4
Mesajlar: 195
Kayıt: 06 Haz 2016, 16:55
Teşekkür etti: 1 kez
Teşekkür edildi: 6 kez

Re: Butonlara Resim Koymak

Mesaj gönderen darendeli »

tamamda nasıl kullanacam tasarladıgım resmi shell32.dll yerine resmin konumunumu yazmam gerekli kullanmak icin. ögrenmek istedigim bu
sadece icon ekleniyorsa demek istedigim olmaz tesekkürler Cevap icin
Kullanıcı avatarı
BlueLife
Kilobyte1
Kilobyte1
Mesajlar: 292
Kayıt: 29 Ağu 2014, 20:42
Teşekkür etti: 45 kez
Teşekkür edildi: 68 kez

Re: Butonlara Resim Koymak

Mesaj gönderen BlueLife »

Icon dosyasını derlerken autoit.exe sine ekliyorsun. Iconların sıralamsı olur ona gore harf yazıyoruz. Yukarıdakine ek yapayım biraz incele.
Tabi exeye cevirip bak...

Kod: Tümünü seç

#include <GUIConstantsEx.au3>
#include <ButtonConstants.au3>

Example()

Func Example()
	Local $msg
	Local $IconFile = @AutoItExe

	GUICreate("My GUI") ; will create a dialog box that when displayed is centered

	Local $btn1 = GUICtrlCreateButton("my picture button", 10, 20, 40, 40, $BS_ICON)
	GUICtrlSetImage($btn1, $IconFile, -1)

	Local $btn2 = GUICtrlCreateButton("my picture button", 10, 65, 40, 40, $BS_ICON)
	GUICtrlSetImage($btn2, $IconFile, -2)

	Local $btn3 = GUICtrlCreateButton("my picture button", 10, 110, 40, 40, $BS_ICON)
	GUICtrlSetImage($btn3, $IconFile, -3)

	Local $btn4 = GUICtrlCreateButton("my picture button", 10, 110, 40, 40, $BS_ICON)
	GUICtrlSetImage($btn4, $IconFile, -4)


	Local $btn1 = GUICtrlCreateButton("my picture button", 10, 220, 100, 40)
	GUICtrlSetImage($btn1, $IconFile, -1)

	Local $btn2 = GUICtrlCreateButton("my picture button", 10, 265, 100, 40)
	GUICtrlSetImage($btn2, $IconFile, -2)

	Local $btn3 = GUICtrlCreateButton("my picture button", 10, 310, 100, 40)
	GUICtrlSetImage($btn3, $IconFile, -3)

	Local $btn4 = GUICtrlCreateButton("my picture button", 10, 310, 100, 40)
	GUICtrlSetImage($btn4, $IconFile, -4)

	GUISetState()

	; Run the GUI until the dialog is closed
	While 1
		$msg = GUIGetMsg()

		If $msg = $GUI_EVENT_CLOSE Then ExitLoop
	WEnd
EndFunc   ;==>Example
Cevapla

“Programlama ve Script dilleri” sayfasına dön