Jump to content

ICONS how to use PNG files as background


Recommended Posts

ICONS how to use PNG files as background

help! ICONS how to use PNG files as background

Now I do use the PNG background shows some problems No title bar

I need to use PNG images and the program does not do background title bar

========================================

$hForm = GUICreate('GUICtrlSetOnHover & Icons UDFs Demonstration', 1050, 500 , -1, -1, , $WS_POPUP, $WS_EX_LAYERED);;;;; see Here($WS_POPUP)

$Back = GUICtrlCreatePic(@ScriptDir & '\Images\background.png', 0, 0, 1050, 500);;;;see Here use PNG files(background.png)

========================================

Here is the script :

#Include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#Include <UDFs\GUICtrlSetOnHover.au3>
#Include <UDFs\Icons.au3>
#include <GDIPlus.au3>
#include <File.au3>
#include <Array.au3>
#include <WindowsConstants.au3>
#include <GuiConstantsEx.au3>
#include <ButtonConstants.au3>


Opt('MustDeclareVars', 0)

Global $Hold = False

$hForm = GUICreate('GUICtrlSetOnHover & Icons UDFs Demonstration', 1050, 500 , -1, -1, , $WS_POPUP, $WS_EX_LAYERED);;;;; see Here($WS_POPUP)

$Back = GUICtrlCreatePic(@ScriptDir & '\Images\background.png', 0, 0, 1050, 500);;;;see Here use PNG files(background.png)
GUICtrlSetState(-1, $GUI_DISABLE)

$ButtonPrev = GUICtrlCreatePic('', 452, 370, 64, 64)
GUICtrlSetOnHover(-1, '_Hover', '_Leave', '_Down', '_Up')
 GUICtrlSetCursor(-1, 0)

$ButtonNext = GUICtrlCreatePic('', 535, 370, 64, 64)
GUICtrlSetOnHover(-1, '_Hover', '_Leave', '_Down', '_Up')
 GUICtrlSetCursor(-1, 0)
$Pic1 = GUICtrlCreatePic('', 82, 70, 256, 256)
GUICtrlSetOnHover(-1, '_Hover', '_Leave','_Down')
$Pic2 = GUICtrlCreatePic('', 397, 70, 256, 256)
GUICtrlSetOnHover(-1, '_Hover', '_Leave')
$Pic3 = GUICtrlCreatePic('', 712, 70, 256, 256)
GUICtrlSetOnHover(-1, '_Hover', '_Leave')

For $i = $ButtonPrev To $Pic3
 _Leave($i)
Next

GUISetState()

Do
Until GUIGetMsg() = -3

Func _Down($CtrlID)

 If $Hold Then
  Return
 Else
  $Hold = True
 EndIf

 Local $File

 Switch $CtrlID
  Case $ButtonPrev
   $File = 'button_prev_down.png'
  Case $ButtonNext
   $File = 'button_next_down.png'
    MsgBox(64,"aaa","aaa")
    
  Case $Pic1
   $File = 'button_next_down.png'
    MsgBox(64,"aaa","aaa")    
 EndSwitch
 _SetImage($CtrlID, @ScriptDir & '\Images\' & $File, $Back)
EndFunc   ;==>_Down

Func _Leave($CtrlID)

 Local $File

 Switch $CtrlID
  Case $ButtonPrev
   $File = 'button_prev.png'
GUICtrlSetTip(-1, "tip of my label")

  Case $ButtonNext
   $File = 'button_next.png'
  Case $Pic1
   $File = 'pic1.png'
  Case $Pic2
   $File = 'pic2.png'
  Case $Pic3
   $File = 'pic3.png'
 EndSwitch
 _SetImage($CtrlID, @ScriptDir & '\Images\' & $File, $Back)
 $Hold = False
EndFunc   ;==>_Leave

Func _Hover($CtrlID)

 Local $File

 Switch $CtrlID
  Case $ButtonPrev
   $File = 'button_prev_hover.png'
   
  Case $ButtonNext
   $File = 'button_next_hover.png'
  Case $Pic1
   $File = 'pic1_hover.png'
  Case $Pic2
   $File = 'pic2_hover.png'
  Case $Pic3
   $File = 'pic3_hover.png'
 EndSwitch
 _SetImage($CtrlID, @ScriptDir & '\Images\' & $File, $Back)
 $Hold = False
EndFunc   ;==>_Hover

Func _Up($CtrlID)
 _Hover($CtrlID)
EndFunc   ;==>_Up
Edited by loveau3
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...