Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 10/26/2023 in all areas

  1. The question is a little bit vague. RGB function in VB returns a long number representing an RGB color value. Basically you don't have to do anything special in order to pass RGB(255,0,0) unless you don't know how each channel value is represented as hex value. If your question is simply about passing data, in your specific case you can simply pass the value 0xFF0000 and you are fine but if you don't know how each channel is combined to get the final RGB value then @ioa747's example is your answer.
    1 point
  2. If that helps $col = HexToRGB("0x84ACF0") $col2 = RGBToHex($col[0], $col[1], $col[2]) ConsoleWrite("$col2=" & $col2 & @CRLF) ;---------------------------------------------------------------------------------------- Func HexToRGB($HexColor) Local $aSplit = StringSplit($HexColor, "") Local $RGB[3] If $aSplit[0] = 8 Then $RGB[0] = Dec($aSplit[3] & $aSplit[4], 0) $RGB[1] = Dec($aSplit[5] & $aSplit[6], 0) $RGB[2] = Dec($aSplit[7] & $aSplit[8], 0) ;ConsoleWrite("RGB(" & $RGB[0] & "," & $RGB[1] & "," & $RGB[2] & ")" & @CRLF) Return $RGB Else ConsoleWrite("Something wrong $aSplit[0]=" & $aSplit[0] & @CRLF) EndIf EndFunc ;==>HexToRGB ;---------------------------------------------------------------------------------------- Func RGBToHex($R, $G, $B) $sColor = "0x" $sColor &= Hex($R, 2) $sColor &= Hex($G, 2) $sColor &= Hex($B, 2) ;ConsoleWrite("$sColor=" & $sColor & @CRLF) Return $sColor EndFunc ;----------------------------------------------------------------------------------------
    1 point
  3. Already done after reading your first post Cheers
    1 point
  4. Feature request done to Trac (bug tracker) I didn't knew there was such bug tracker, sorry about that. Ticket: https://www.autoitscript.com/trac/autoit/ticket/3979
    1 point
  5. Try this : #include <WinAPIShellEx.au3> #include <WinAPIConv.au3> #include <GUIConstants.au3> Global $hGUI = GUICreate("UpDown and scroll", -1, -1, -1, -1, $WS_SIZEBOX) Global $idInput = GUICtrlCreateInput("2", 10, 10, 50, 20) ;~ $hInput = GUICtrlGetHandle($idInput) Global $idUpdown = GUICtrlCreateUpdown($idInput) ;~ $hUpdown =GUICtrlGetHandle($idUpdown) GUISetState(@SW_SHOW) Global $hDll = DllCallbackRegister(SubclassProc, 'lresult', 'hwnd;uint;wparam;lparam;uint_ptr;dword_ptr') Global $pDll = DllCallbackGetPtr($hDll) _WinAPI_SetWindowSubclass($hGUI, $pDll, $idInput, 0) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd GUIDelete() _WinAPI_RemoveWindowSubclass($hGUI, $pDll, 1000) DllCallbackFree($hDll) Func SubclassProc($hWnd, $iMsg, $wParam, $lParam, $iID, $pData) If $iMsg = $WM_MOUSEWHEEL Then Local $iDelta = _WinAPI_HiWord($wParam) Local $iCurrent = GUICtrlRead($iID) GUICtrlSetData($iID, $iDelta > 0 ? $iCurrent + 1 : $iCurrent - 1) EndIf Return _WinAPI_DefSubclassProc($hWnd, $iMsg, $wParam, $lParam) EndFunc ;==>_SubclassProc
    1 point
×
×
  • Create New...