CODICE
;ARGB Hex Converter - by Misterx
#include <GuiConstants.au3>
#include <GdiPlus.au3>
Global $title = "ARGB Hex Converter - by Misterx"
$gui = GUICreate($title,460,130)
GUICtrlCreateLabel("Alpha",10,10)
$alpha = GUICtrlCreateSlider(50,8,255,20,0x0010)
GUICtrlSetLimit($alpha,255,0)
$alphan = GUICtrlCreateLabel("0",315,10,20)
GUICtrlCreateLabel("Rosso",10,40)
$rosso = GUICtrlCreateSlider(50,38,255,20,0x0010)
GUICtrlSetLimit($rosso,255,0)
$rosson = GUICtrlCreateLabel("0",315,40,20)
GUICtrlCreateLabel("Verde",10,70)
$verde = GUICtrlCreateSlider(50,68,255,20,0x0010)
GUICtrlSetLimit($verde,255,0)
$verden = GUICtrlCreateLabel("0",315,70,20)
GUICtrlCreateLabel("Blu",10,100)
$blu = GUICtrlCreateSlider(50,98,255,20,0x0010)
GUICtrlSetLimit($blu,255,0)
$blun = GUICtrlCreateLabel("0",315,100,20)
Dim $hexv[4] = [00,00,00,00]
$hex = GUICtrlCreateInput("0x00000000",350,5,100,20)
GUISetState()
_GDIPlus_Startup()
$h = _GDIPlus_GraphicsCreateFromHWND($gui)
$brush = _GDIPlus_BrushCreateSolid()
_GDIPlus_GraphicsFillRect($h,350, 35, 100, 80,$brush)
While 1
If GUICtrlRead($alpha) <> GUICtrlRead($alphan) Then
$at = GUICtrlRead($alpha)
GUICtrlSetData($alphan,$at)
$hexv[0] = Number($at)
set()
EndIf
If GUICtrlRead($rosso) <> GUICtrlRead($rosson) Then
$rt = GUICtrlRead($rosso)
GUICtrlSetData($rosson,$rt)
$hexv[1] = Number($rt)
set()
EndIf
If GUICtrlRead($verde) <> GUICtrlRead($verden) Then
$vt = GUICtrlRead($verde)
GUICtrlSetData($verden,$vt)
$hexv[2] = Number($vt)
set()
EndIf
If GUICtrlRead($blu) <> GUICtrlRead($blun) Then
$bt = GUICtrlRead($blu)
GUICtrlSetData($blun,$bt)
$hexv[3] = Number($bt)
set()
EndIf
Switch GUIGetMsg()
Case $gui_event_close
Exit
EndSwitch
WEnd
Func set()
$0 = StringRight(Hex($hexv[0]),2)
$1 = StringRight(Hex($hexv[1]),2)
$2 = StringRight(Hex($hexv[2]),2)
$3 = StringRight(Hex($hexv[3]),2)
$fin = "0x" & $0 & $1 & $2 & $3
GUICtrlSetData($hex,$fin)
$brush = _GDIPlus_BrushCreateSolid()
$h = _GDIPlus_GraphicsCreateFromHWND($gui)
_GDIPlus_BrushSetSolidColor($brush,$fin)
_GDIPlus_GraphicsFillRect($h,350, 35, 100, 80,$brush)
EndFunc