Jump to content

UEZ

MVPs
  • Posts

    7,344
  • Joined

  • Last visited

  • Days Won

    80

Reputation Activity

  1. Thanks
    UEZ got a reaction from pixelsearch in WebP v0.3.7 build 2025-07-03 beta   
    Updated to WebP v0.3.7 build 2025-07-03 beta
    You can now create WebP anim files from WebP image files and you can extract frames from a WebP anim file to WebP image file format.
    Supported GDIPlus image formats: "bmp", "gif", "jpg", "tif", "png"
  2. Like
    UEZ got a reaction from KaFu in WebP v0.3.7 build 2025-07-03 beta   
    Updated to WebP v0.3.7 build 2025-07-03 beta
    You can now create WebP anim files from WebP image files and you can extract frames from a WebP anim file to WebP image file format.
    Supported GDIPlus image formats: "bmp", "gif", "jpg", "tif", "png"
  3. Thanks
    UEZ reacted to pixelsearch in WebP v0.3.7 build 2025-07-03 beta   
    You're welcome, it's the least we can do for you
    Just curious : example 8 creates a WebP animation from 4 possible types of image files :
    "images (*.jpg;*.png;*.bmp;*.gif)" Do you think it would be possible to add this 5th type of image file, if not too complicated ?
    "images (*.jpg;*.png;*.bmp;*.gif;*.webp)" Thanks
  4. Like
    UEZ got a reaction from pixelsearch in WebP v0.3.7 build 2025-07-03 beta   
    Updated to WebP v0.3.6 build 2025-07-02 beta -> you can convert now GIF animated files to WebP animated files (see Example10.au3 on my 1Drv).
  5. Like
    UEZ got a reaction from KaFu in WebP v0.3.7 build 2025-07-03 beta   
    Updated to WebP v0.3.6 build 2025-07-02 beta -> you can convert now GIF animated files to WebP animated files (see Example10.au3 on my 1Drv).
  6. Like
    UEZ got a reaction from KaFu in WebP v0.3.7 build 2025-07-03 beta   
    Yes, I forgot to removed these lines for the other functions but I need to add the code also for the other function with callbacks.
     
    Currently only function "WebP_CreateWebPCreateAnimFromScreenCapture" in the dll is implemented (example 9) for callback but it should be easy to add also for the other functions.
     
    I think tomorrow I will add it to the other functions, too.
  7. Thanks
    UEZ got a reaction from pixelsearch in WebP v0.3.7 build 2025-07-03 beta   
    Yes, I forgot to removed these lines for the other functions but I need to add the code also for the other function with callbacks.
     
    Currently only function "WebP_CreateWebPCreateAnimFromScreenCapture" in the dll is implemented (example 9) for callback but it should be easy to add also for the other functions.
     
    I think tomorrow I will add it to the other functions, too.
  8. Thanks
    UEZ reacted to pixelsearch in WebP v0.3.7 build 2025-07-03 beta   
    Yes it is working. The 10s output file "Captured.webp" displays in the GUI, then loops until we close the GUI. It displays same in IrfanView.
  9. Thanks
    UEZ reacted to pixelsearch in WebP v0.3.7 build 2025-07-03 beta   
    Hello @UEZ
    Just downloaded all your files (including the Frames subfolder containing 10 png files to create the animation). Somes files were updated 3 hours ago, lucky me to download the brand new release just now
    Example 8 worked fine and the created animation "TestAnim.webp" displayed without any issue.
    Well done
  10. Like
    UEZ got a reaction from pixelsearch in WebP v0.3.7 build 2025-07-03 beta   
    Updated to: WebP v0.3.5 build 2025-06-27 beta
    You can now create WebP animated files.
    Examples8 encodes GDI+ supported image files to an animation.
    Example9 captures the desktop screen to an WebP anim file.
     
  11. Like
    UEZ reacted to argumentum in How to pin a script to the taskbar or start menu   
    vs.     
    If you would like to pin the script to the taskbar ( or the start  menu ), it can be done with a link. This script is an example and demonstration.
    The way that I go about it, is to have the script and icon with the same name. The easiest way to test this is if the post had it all in a ZIP file so, there:
    Example AutoIt v3 Script_v2.zip
    Also, it's easier to find in task manager given that you can see your icon.
     
  12. Like
    UEZ got a reaction from WildByDesign in Embedding font in compiled binary and loading per-session   
    Here you should find one way how to embed your font (Display Font from Memory):
     
     
  13. Like
    UEZ got a reaction from wakillon in Tester needed ^^   
    @argumentum I hope you don't mind me doing something similar in parallel.
    I would like to test the code on different OS, need your support. It would make sense to have 2+ monitors, if possible with > 96 DPI. I don't know from which os it is possible to set different DPIs per monitor (WIn10+?).
    I tested it on Win11 22H2 and worked properly on 3 monitors with 3 different DPIs (left 100%, middle 125 % (main), right 150%). Just run the code and move the GUI over all your monitors. Theoretically the GUI should be adjusted accordingly.
     
    _WinAPI_DPI.au3:
    ;Coded by UEZ build 2023-08-15 beta #include-once #include <GDIPlus.au3> #include <Misc.au3> #include <WinAPISysWin.au3> #include <WinAPIsysinfoConstants.au3> #Region DPI Constants ;https://learn.microsoft.com/en-us/windows/win32/api/windef/ne-windef-dpi_awareness Global Enum $DPI_AWARENESS_INVALID = -1, $DPI_AWARENESS_UNAWARE = 0, $DPI_AWARENESS_SYSTEM_AWARE = 1, $DPI_AWARENESS_PER_MONITOR_AWARE = 2 ;https://learn.microsoft.com/en-us/windows/win32/hidpi/dpi-awareness-context Global Const $DPI_AWARENESS_CONTEXT_UNAWARE = $DPI_AWARENESS_UNAWARE - 1 Global Const $DPI_AWARENESS_CONTEXT_SYSTEM_AWARE = $DPI_AWARENESS_UNAWARE - 2 Global Const $DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE = $DPI_AWARENESS_UNAWARE - 3 Global Const $DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2 = $DPI_AWARENESS_UNAWARE - 4 Global Const $DPI_AWARENESS_CONTEXT_UNAWARE_GDISCALED = $DPI_AWARENESS_UNAWARE - 5 ; enum _MONITOR_DPI_TYPE Global Enum $MDT_EFFECTIVE_DPI = 0, $MDT_ANGULAR_DPI, $MDT_RAW_DPI Global Const $MDT_DEFAULT = $MDT_EFFECTIVE_DPI ;Windows Message Codes Global Const $WM_DPICHANGED = 0x02E0, $WM_DPICHANGED_BEFOREPARENT = 0x02E2, $WM_DPICHANGED_AFTERPARENT = 0x02E3, $WM_GETDPISCALEDSIZE = 0x02E4 #EndRegion DPI Constants #Region WinAPI DPI ;https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-adjustwindowrectexfordpi Func _WinAPI_AdjustWindowRectExForDpi($dpi, $dwStyle, $dwExStyle, $bMenu = False) Local $tRECT = DllStructCreate($tagRECT) Local $aResult = DllCall("user32.dll", "bool", "AdjustWindowRectExForDpi", "struct*", $tRECT, "dword", $dwStyle, "bool", $bMenu, "dword", $dwExStyle, "int", $dpi) ;requires Win10 v1607+ / no server support If Not IsArray($aResult) Or @error Then Return SetError(1, @extended, 0) If $aResult[0] Then Return SetError(2, @extended, 0) Return $tRECT EndFunc ;==>_WinAPI_AdjustWindowRectExForDpi ;https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-systemparametersinfofordpi Func _WinAPI_SystemParametersInfoForDpi($uiAction, $uiParam, $pvParam, $fWinIni, $dpi) Local $aResult = DllCall("user32.dll", "bool", "SystemParametersInfoForDpi", "uint", $uiAction, "uint", $uiParam, "struct*", $pvParam, "uint", $fWinIni, "uint", $dpi) ;requires Win10 v1607+ / no server support If Not IsArray($aResult) Or @error Then Return SetError(1, @extended, 0) If Not $aResult[0] Then Return SetError(2, @extended, 0) Return $aResult[0] EndFunc ;==>_WinAPI_SystemParametersInfoForDpi ;https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-inheritwindowmonitor Func _WinAPI_InheritWindowMonitor($hWnd, $hWndInherit) Local $aResult = DllCall("user32.dll", "bool", "InheritWindowMonitor", "hwnd", $hWnd, "hwnd", $hWndInherit) ;requires Win10 v1803+ / Windows Server 2016+ If Not IsArray($aResult) Or @error Then Return SetError(1, @extended, 0) If Not $aResult[0] Then Return SetError(2, @extended, 0) Return $aResult[0] EndFunc ;==>_WinAPI_InheritWindowMonitor ;https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-isvaliddpiawarenesscontext Func _WinAPI_IsValidDpiAwarenessContext($DPI_AWARENESS_CONTEXT_value) Local $aResult = DllCall("user32.dll", "bool", "IsValidDpiAwarenessContext", @AutoItX64 ? "int64" : "int", $DPI_AWARENESS_CONTEXT_value) ;requires Win10 v1607+ / no server support If Not IsArray($aResult) Or @error Then Return SetError(1, @extended, 0) If Not $aResult[0] Then Return SetError(2, @extended, 0) Return $aResult[0] EndFunc ;==>_WinAPI_IsValidDpiAwarenessContext ;https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-logicaltophysicalpointforpermonitordpi Func _WinAPI_LogicalToPhysicalPointForPerMonitorDPI($hWnd) Local $tPOINT = DllStructCreate($tagPOINT) Local $aResult = DllCall("user32.dll", "bool", "LogicalToPhysicalPointForPerMonitorDPI", "hwnd", $hWnd, "struct*", $tPOINT) ;requires Win 8.1+ / no server support If Not IsArray($aResult) Or @error Then Return SetError(1, @extended, 0) If Not $aResult[0] Then Return SetError(2, @extended, 0) Return $tPOINT EndFunc ;==>_WinAPI_LogicalToPhysicalPointForPerMonitorDPI ;https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-physicaltologicalpointforpermonitordpi Func _WinAPI_PhysicalToLogicalPointForPerMonitorDPI($hWnd) Local $tPOINT = DllStructCreate($tagPOINT) Local $aResult = DllCall("user32.dll", "bool", "PhysicalToLogicalPointForPerMonitorDPI", "hwnd", $hWnd, "struct*", $tPOINT) ;requires Win 8.1+ / no server support If Not IsArray($aResult) Or @error Then Return SetError(1, @extended, 0) If Not $aResult[0] Then Return SetError(2, @extended, 0) Return $tPOINT EndFunc ;==>_WinAPI_PhysicalToLogicalPointForPerMonitorDPI Func _GDIPlus_GetDPI($hGUI = 0) _GDIPlus_Startup() Local $hGfx = _GDIPlus_GraphicsCreateFromHWND($hGUI) If @error Then Return SetError(1, @extended, 0) Local $aResult = DllCall($__g_hGDIPDll, "int", "GdipGetDpiX", "handle", $hGfx, "float*", 0) If @error Then Return SetError(2, @extended, 0) _GDIPlus_GraphicsDispose($hGfx) _GDIPlus_Shutdown() Return $aResult[2] EndFunc ;==>_GDIPlus_GetDPI Func _WinAPI_GetDPI($hWnd = 0) $hWnd = Not $hWnd ? _WinAPI_GetDesktopWindow() : $hWnd Local Const $hDC = _WinAPI_GetDC($hWnd) If @error Then Return SetError(1, 0, 0) Local Const $iDPI = _WinAPI_GetDeviceCaps($hDC, $LOGPIXELSX) If @error Or Not $iDPI Then _WinAPI_ReleaseDC($hWnd, $hDC) Return SetError(2, 0, 0) EndIf _WinAPI_ReleaseDC($hWnd, $hDC) Return $iDPI EndFunc ;==>_WinAPI_GetDPI ;https://learn.microsoft.com/en-us/windows/win32/api/shellscalingapi/nf-shellscalingapi-getdpiformonitor Func _WinAPI_GetDpiForPrimaryMonitor($hMOnitor = 0, $dpiType = $MDT_DEFAULT) If $hMOnitor = 0 Then Local $aMonitors = _WinAPI_EnumDisplayMonitors() If @error Or Not IsArray($aMonitors) Then Return SetError(1, 0, 0) Local $i For $i = 1 To $aMonitors[0][0] If _WinAPI_GetMonitorInfo($aMonitors[$i][0])[2] = 1 Then $hMOnitor = $aMonitors[$i][0] ExitLoop EndIf Next EndIf Local $tx = DllStructCreate("int dpiX"), $tY = DllStructCreate("int dpiY") Local $aResult = DllCall("Shcore.dll", "long", "GetDpiForMonitor", "handle", $hMOnitor, "long", $dpiType, "struct*", $tx, "struct*", $tY) If @error Or Not IsArray($aResult) Then Return SetError(2, 0, 0) Return $tx.dpiX EndFunc ;==>_WinAPI_GetDpiForPrimaryMonitor ;https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getdpiforwindow Func _WinAPI_GetDpiForWindow($hWnd) Local $aResult = DllCall("user32.dll", "uint", "GetDpiForWindow", "hwnd", $hWnd) ;requires Win10 v1607+ / no server support If Not IsArray($aResult) Or @error Then Return SetError(1, @extended, 0) If Not $aResult[0] Then Return SetError(2, @extended, 0) Return $aResult[0] EndFunc ;==>_WinAPI_GetDpiForWindow ;https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getdpiforsystem Func _WinAPI_GetDpiForSystem() Local $aResult = DllCall("user32.dll", "uint", "GetDpiForSystem") ;requires Win10 v1607+ / no server support If Not IsArray($aResult) Or @error Then Return SetError(1, @extended, 0) If Not $aResult[0] Then Return SetError(2, @extended, 0) Return $aResult[0] EndFunc ;==>_WinAPI_GetDpiForSystem ;https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getthreaddpiawarenesscontext Func _WinAPI_GetThreadDpiAwarenessContext() Local $aResult = DllCall("user32.dll", "uint", "GetThreadDpiAwarenessContext") ;requires Win10 v1607+ / no server support If Not IsArray($aResult) Or @error Then Return SetError(1, @extended, 0) If Not $aResult[0] Then Return SetError(2, @extended, 0) Return $aResult[0] EndFunc ;==>_WinAPI_GetThreadDpiAwarenessContext ;https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getdpifromdpiawarenesscontext Func _WinAPI_GetDpiFromDpiAwarenessContext($DPI_AWARENESS_CONTEXT_value) Local $aResult = DllCall("user32.dll", "uint", "GetDpiFromDpiAwarenessContext", @AutoItX64 ? "int64" : "int", $DPI_AWARENESS_CONTEXT_value) ;requires Win10 v1803+ / Windows Server 2016+ If Not IsArray($aResult) Or @error Then Return SetError(1, @extended, 0) If Not $aResult[0] Then Return SetError(2, @extended, 0) Return $aResult[0] EndFunc ;==>_WinAPI_GetDpiFromDpiAwarenessContext ;https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getawarenessfromdpiawarenesscontext Func _WinAPI_GetAwarenessFromDpiAwarenessContext($DPI_AWARENESS_CONTEXT_value) Local $aResult = DllCall("user32.dll", "uint", "GetAwarenessFromDpiAwarenessContext", @AutoItX64 ? "int64" : "int", $DPI_AWARENESS_CONTEXT_value) ;requires Win10 v1607+ / no server support If Not IsArray($aResult) Or @error Then Return SetError(1, @extended, 0) If Not $aResult[0] Then Return SetError(2, @extended, 0) Return $aResult[0] EndFunc ;==>_WinAPI_GetAwarenessFromDpiAwarenessContext ;https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getdpiawarenesscontextforprocess Func _WinAPI_GetDpiAwarenessContextForProcess($hProcess) Local $aResult = DllCall("user32.dll", "uint", "GetDpiAwarenessContextForProcess", "handle", $hProcess) ;requires Win10 v1803+ / Windows Server 2016+ If Not IsArray($aResult) Or @error Then Return SetError(1, @extended, 0) If Not $aResult[0] Then Return SetError(2, @extended, 0) Return $aResult[0] EndFunc ;==>_WinAPI_GetDpiAwarenessContextForProcess ;https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getsystemdpiforprocess Func _WinAPI_GetSystemDpiForProcess($hProcess) Local $aResult = DllCall("user32.dll", "uint", "GetSystemDpiForProcess", "handle", $hProcess) ;requires Win10 v1803+ / Windows Server 2016+ If Not IsArray($aResult) Or @error Then Return SetError(1, @extended, 0) If Not $aResult[0] Then Return SetError(2, @extended, 0) Return $aResult[0] EndFunc ;==>_WinAPI_GetSystemDpiForProcess ;https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getwindowdpiawarenesscontext Func _WinAPI_GetWindowDpiAwarenessContext($hWnd) Local $aResult = DllCall("user32.dll", "uint", "GetWindowDpiAwarenessContext", "hwnd", $hWnd) ;requires Win10 v1607+ / no server support If Not IsArray($aResult) Or @error Then Return SetError(1, @extended, 0) If Not $aResult[0] Then Return SetError(2, @extended, 0) Return $aResult[0] EndFunc ;==>_WinAPI_GetWindowDpiAwarenessContext ;https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-setprocessdpiawarenesscontext Func _WinAPI_SetProcessDpiAwarenessContext($DPI_AWARENESS_CONTEXT_value) Local $aResult = DllCall("user32.dll", "bool", "SetProcessDpiAwarenessContext", @AutoItX64 ? "int64" : "int", $DPI_AWARENESS_CONTEXT_value) ;requires Win10 v1703+ / Windows Server 2016+ If Not IsArray($aResult) Or @error Then Return SetError(1, @extended, 0) If Not $aResult[0] Then Return SetError(2, @extended, 0) Return $aResult[0] EndFunc ;==>_WinAPI_SetProcessDpiAwarenessContext ;https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-setthreaddpiawarenesscontext Func _WinAPI_SetThreadDpiAwarenessContext($DPI_AWARENESS_CONTEXT_value) Local $aResult = DllCall("user32.dll", "uint", "SetThreadDpiAwarenessContext", @AutoItX64 ? "int64" : "int", $DPI_AWARENESS_CONTEXT_value) ;requires Win10 v1703+ / Windows Server 2016+ If Not IsArray($aResult) Or @error Then Return SetError(1, @extended, 0) If Not $aResult[0] Then Return SetError(2, @extended, 0) Return $aResult[0] EndFunc ;==>_WinAPI_SetThreadDpiAwarenessContext ;https://learn.microsoft.com/en-us/windows/win32/api/shellscalingapi/nf-shellscalingapi-setprocessdpiawareness Func _WinAPI_SetProcessDpiAwareness($PROCESS_DPI_AWARENESS = $DPI_AWARENESS_PER_MONITOR_AWARE) Local $aResult = DllCall("Shcore.dll", "long", "SetProcessDpiAwareness", "int", $PROCESS_DPI_AWARENESS) ;requires Win 8.1+ / Server 2012 R2+ If Not IsArray($aResult) Or @error Then Return SetError(1, @extended, 0) If $aResult[0] Then Return SetError(2, $aResult[0], 0) Return $aResult[0] ;0 is S_OK EndFunc ;==>_WinAPI_SetProcessDpiAwareness Func _WinAPI_SetDPIAwareness($DPIAwareContext = $DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE, $iMode = 1) Switch @OSBuild Case 6000 To 9199 Local $aResult = DllCall("user32.dll", "bool", "SetProcessDPIAware") ;requires Vista+ / Server 2008+ If Not $aResult[0] Then Return SetError(1, 0, 0) Case 9200 To 13999 $DPIAwareContext = ($DPIAwareContext < 0) ? 0 : ($DPIAwareContext > 2) ? 2 : $DPIAwareContext _WinAPI_SetProcessDpiAwareness($DPIAwareContext) If @error Then Return SetError(2, @error, 0) Case @OSBuild > 13999 $DPIAwareContext = ($DPIAwareContext < -5) ? -5 : ($DPIAwareContext > -1) ? -1 : $DPIAwareContext $iMode = ($iMode < 1) ? 1 : ($iMode > 2) ? 2 : $iMode Local $iResult Switch $iMode Case 1 $iResult = _WinAPI_SetProcessDpiAwarenessContext($DPIAwareContext) If Not $iResult Or @error Then Return SetError(3, 0, 0) Case 2 #cs Return DPI_AWARENESS_CONTEXT values $DPI_AWARENESS_CONTEXT_UNAWARE = 0x6010 / 24592 $DPI_AWARENESS_CONTEXT_SYSTEM_AWARE = 0x9011 / 36881 $DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE = 0x12 / 18 $DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2 = 0x22 / 34 $DPI_AWARENESS_CONTEXT_UNAWARE_GDISCALED = 0x40006010 / 1073766416 #ce $iResult = _WinAPI_SetThreadDpiAwarenessContext($DPIAwareContext) If Not $iResult Or @error Then Return SetError(4, 0, 0) EndSwitch EndSwitch Local $iDPI If @OSBuild < 9200 Then $iDPI = _WinAPI_GetDPI() If @error Or Not $iDPI Then Return SetError(5, 0, 0) Else $iDPI = _WinAPI_GetDpiForPrimaryMonitor() If @error Or Not $iDPI Then Return SetError(6, 0, 0) EndIf Return $iDPI EndFunc ;==>_WinAPI_SetDPIAwareness #EndRegion WinAPI DPI  
     
    Example.au3:
    ; AutoIt GUI Example ; Created: 17/01/2005 - CyberSlug ; Modifed: 05/12/2011 - guinness ; Modifed: 09/06/2014 - mLipok ; Modifed: 15/10/2018 - mLipok ; Modifed: 14/08/2023 - UEZ #AutoIt3Wrapper_Change2CUI=n #AutoIt3Wrapper_Run_Au3Stripper=y #Au3Stripper_Parameters=/so #AutoIt3Wrapper_Res_HiDpi=n ;must be n otherwise _WinAPI_SetDPIAwareness() function will fail! #AutoIt3Wrapper_UseX64=n #Region INCLUDE #include <AVIConstants.au3> #include <GuiConstantsEx.au3> #include <TreeViewConstants.au3> #include <Array.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WinAPIGdiDC.au3> #include <WindowsConstants.au3> #include "_WinAPI_DPI.au3" #EndRegion INCLUDE #Region INITIALIZATION and EXIT Global $aCtrl[43][6], $ahWnd[2][10], $g_iDPI_ratio1, $g_iDPI_ratio2, $iw = 400, $ih = 200 _Example() ; Finished! #EndRegion INITIALIZATION and EXIT Func _Example() Local $AWARENESS Switch @OSBuild Case 9200 To 13999 $AWARENESS = $DPI_AWARENESS_PER_MONITOR_AWARE Case @OSBuild > 13999 $AWARENESS = $DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2 EndSwitch Local $iDPI = _WinAPI_SetDPIAwareness($AWARENESS, 2), $iDPI_def = 96 If $iDPI = 0 Then Exit MsgBox($MB_ICONERROR, "ERROR", "Unable to set DPI awareness!!!", 10) $g_iDPI_ratio1 = $iDPI / $iDPI_def $g_iDPI_ratio2 = $iDPI_def / $iDPI #Region GUI Local $sPath = RegRead("HKLM\SOFTWARE\" & (@AutoItX64 ? "WOW6432Node\" : "") & "AutoIt v3\AutoIt", "InstallDir") $sPath = ($sPath = "" ? @ProgramFilesDir & "\AutoIt3\" : $sPath & "\") ;assume default path $ahWnd[0][1] = 8.5 * $g_iDPI_ratio1 $ahWnd[0][0] = GUICreate("DPI Sample GUI", 400 * $g_iDPI_ratio1, 400 * $g_iDPI_ratio1) GUISetIcon(@SystemDir & "\mspaint.exe", 0) GUISetFont($ahWnd[0][1], 400, 0, "Arial", $ahWnd[0][0], $CLEARTYPE_QUALITY) #EndRegion GUI #Region MENU $aCtrl[1][0] = GUICtrlCreateMenu("Menu &One") $aCtrl[2][0] = GUICtrlCreateMenu("Menu &Two") $aCtrl[3][0] = GUICtrlCreateMenu("Menu Th&ree") $aCtrl[4][0] = GUICtrlCreateMenu("Menu &Four") GUICtrlCreateMenuItem('SubMenu One &A', $aCtrl[1][0]) GUICtrlCreateMenuItem('SubMenu One &B', $aCtrl[1][0]) #EndRegion MENU #Region CONTEXT MENU $aCtrl[5][0] = GUICtrlCreateContextMenu() GUICtrlCreateMenuItem("Context Menu", $aCtrl[5][0]) GUICtrlCreateMenuItem("", $aCtrl[5][0]) ; Separator GUICtrlCreateMenuItem("&Properties", $aCtrl[5][0]) #EndRegion CONTEXT MENU #Region PIC $aCtrl[6][2] = 0 ;x $aCtrl[6][3] = 0 ;y $aCtrl[6][4] = 169 ;w $aCtrl[6][5] = 68 ;h $aCtrl[6][0] = GUICtrlCreatePic($sPath & "Examples\GUI\logo4.gif", $aCtrl[6][2] * $g_iDPI_ratio1, $aCtrl[6][3] * $g_iDPI_ratio1, $aCtrl[6][4] * $g_iDPI_ratio1, $aCtrl[6][5] * $g_iDPI_ratio1) GUICtrlSetTip(-1, '#Region PIC') $aCtrl[7][2] = 75 $aCtrl[7][3] = 1 $aCtrl[7][4] = 80 $aCtrl[7][5] = 16 $aCtrl[7][1] = 8.5 * $g_iDPI_ratio2 $aCtrl[7][0] = GUICtrlCreateLabel("Sample Pic", $aCtrl[7][2] * $g_iDPI_ratio1, $aCtrl[7][3] * $g_iDPI_ratio1, $aCtrl[7][4] * $g_iDPI_ratio1, $aCtrl[7][5] * $g_iDPI_ratio1) GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) GUICtrlSetColor(-1, 0xFFFFFF) GUICtrlSetFont(-1, $aCtrl[7][1] * $g_iDPI_ratio1) #EndRegion PIC #Region AVI $aCtrl[8][2] = 180 $aCtrl[8][3] = 10 $aCtrl[8][4] = 32 $aCtrl[8][5] = 32 $aCtrl[8][0] = GUICtrlCreateAvi($sPath & "Examples\GUI\SampleAVI.avi", 0, $aCtrl[8][2] * $g_iDPI_ratio1, $aCtrl[8][3] * $g_iDPI_ratio1, $aCtrl[8][4] * $g_iDPI_ratio1, $aCtrl[8][5] * $g_iDPI_ratio1, $ACS_AUTOPLAY) GUICtrlSetTip(-1, '#Region AVI') ; TODO $aCtrl[9][2] = 175 $aCtrl[9][3] = 50 $aCtrl[9][4] = 50 $aCtrl[9][5] = 12 $aCtrl[9][1] = 8.5 * $g_iDPI_ratio2 $aCtrl[9][0] = GUICtrlCreateLabel("Sample avi", $aCtrl[9][2] * $g_iDPI_ratio1, $aCtrl[9][3] * $g_iDPI_ratio1, $aCtrl[9][4] * $g_iDPI_ratio1, $aCtrl[9][5] * $g_iDPI_ratio1) GUICtrlSetTip(-1, '#Region AVI - Label') GUICtrlSetFont(-1, $aCtrl[9][1] * $g_iDPI_ratio1) #EndRegion AVI #Region TAB $aCtrl[10][2] = 240 $aCtrl[10][3] = 0 $aCtrl[10][4] = 150 $aCtrl[10][5] = 70 $aCtrl[10][1] = 8.5 * $g_iDPI_ratio2 $aCtrl[10][0] = GUICtrlCreateTab($aCtrl[10][2] * $g_iDPI_ratio1, $aCtrl[10][3] * $g_iDPI_ratio1, $aCtrl[10][4] * $g_iDPI_ratio1, $aCtrl[10][5] * $g_iDPI_ratio1) GUICtrlSetFont(-1, $aCtrl[10][1] * $g_iDPI_ratio1) $aCtrl[11][0] = GUICtrlCreateTabItem("One") GUICtrlSetTip(-1, '#Region TAB1') $aCtrl[12][2] = 244 $aCtrl[12][3] = 35 $aCtrl[12][4] = 140 $aCtrl[12][5] = 24 $aCtrl[12][1] = 8.5 * $g_iDPI_ratio2 $aCtrl[12][0] = GUICtrlCreateLabel("Sample Tab with TabItems", $aCtrl[12][2] * $g_iDPI_ratio1, $aCtrl[12][3] * $g_iDPI_ratio1, $aCtrl[12][4] * $g_iDPI_ratio1, $aCtrl[12][5] * $g_iDPI_ratio1) GUICtrlSetFont(-1, $aCtrl[12][1] * $g_iDPI_ratio1) $aCtrl[13][0] = GUICtrlCreateTabItem("Two") GUICtrlSetTip(-1, '#Region TAB2') $aCtrl[14][0] = GUICtrlCreateTabItem("Three") GUICtrlSetTip(-1, '#Region TAB3') GUICtrlCreateTabItem("") #EndRegion TAB #Region COMBO $aCtrl[15][2] = 250 $aCtrl[15][3] = 80 $aCtrl[15][4] = 120 $aCtrl[15][5] = 100 $aCtrl[15][1] = 8.5 * $g_iDPI_ratio2 $aCtrl[15][0] = GUICtrlCreateCombo("Sample Combo", $aCtrl[15][2] * $g_iDPI_ratio1, $aCtrl[15][3] * $g_iDPI_ratio1, $aCtrl[15][4] * $g_iDPI_ratio1, $aCtrl[15][5] * $g_iDPI_ratio1) GUICtrlSetTip(-1, '#Region COMBO') GUICtrlSetFont(-1, $aCtrl[15][1] * $g_iDPI_ratio1) #EndRegion COMBO #Region PROGRESS $aCtrl[16][2] = 60 $aCtrl[16][3] = 80 $aCtrl[16][4] = 150 $aCtrl[16][5] = 20 $aCtrl[16][0] = GUICtrlCreateProgress($aCtrl[16][2] * $g_iDPI_ratio1, $aCtrl[16][3] * $g_iDPI_ratio1, $aCtrl[16][4] * $g_iDPI_ratio1, $aCtrl[16][5] * $g_iDPI_ratio1) GUICtrlSetTip(-1, '#Region PROGRES') GUICtrlSetData(-1, 60) $aCtrl[17][2] = 5 $aCtrl[17][3] = 82 $aCtrl[17][4] = 50 $aCtrl[17][5] = 18 $aCtrl[17][1] = 8.5 * $g_iDPI_ratio2 $aCtrl[17][0] = GUICtrlCreateLabel("Progress:", $aCtrl[17][2] * $g_iDPI_ratio1, $aCtrl[17][3] * $g_iDPI_ratio1, $aCtrl[17][4] * $g_iDPI_ratio1, $aCtrl[17][5] * $g_iDPI_ratio1) GUICtrlSetTip(-1, '#Region PROGRES - Label') GUICtrlSetFont(-1, $aCtrl[17][1] * $g_iDPI_ratio1) #EndRegion PROGRESS #Region EDIT $aCtrl[18][2] = 10 $aCtrl[18][3] = 110 $aCtrl[18][4] = 150 $aCtrl[18][5] = 70 $aCtrl[18][1] = 8.5 * $g_iDPI_ratio2 $aCtrl[18][0] = GUICtrlCreateEdit(@CRLF & " Sample Edit Control", $aCtrl[18][2] * $g_iDPI_ratio1, $aCtrl[18][3] * $g_iDPI_ratio1, $aCtrl[18][4] * $g_iDPI_ratio1, $aCtrl[18][5] * $g_iDPI_ratio1) GUICtrlSetTip(-1, '#Region EDIT') GUICtrlSetFont(-1, $aCtrl[18][1] * $g_iDPI_ratio1) #EndRegion EDIT #Region LIST $aCtrl[19][2] = 5 $aCtrl[19][3] = 190 $aCtrl[19][4] = 100 $aCtrl[19][5] = 90 $aCtrl[19][1] = 8.5 * $g_iDPI_ratio2 $aCtrl[19][0] = GUICtrlCreateList("", $aCtrl[19][2] * $g_iDPI_ratio1, $aCtrl[19][3] * $g_iDPI_ratio1, $aCtrl[19][4] * $g_iDPI_ratio1, $aCtrl[19][5] * $g_iDPI_ratio1) GUICtrlSetFont(-1, $aCtrl[19][1] * $g_iDPI_ratio1) GUICtrlSetTip(-1, '#Region LIST') GUICtrlSetData(-1, "A.Sample|B.List|C.Control|D.Here", "B.List") #EndRegion LIST #Region ICON $aCtrl[20][2] = 175 $aCtrl[20][3] = 120 $aCtrl[20][4] = 32 $aCtrl[20][5] = 32 $aCtrl[20][0] = GUICtrlCreateIcon("explorer.exe", 0, $aCtrl[20][2] * $g_iDPI_ratio1, $aCtrl[20][3] * $g_iDPI_ratio1, $aCtrl[20][4] * $g_iDPI_ratio1, $aCtrl[20][5] * $g_iDPI_ratio1) GUICtrlSetTip(-1, '#Region ICON') $aCtrl[21][2] = 180 $aCtrl[21][3] = 160 $aCtrl[21][4] = 50 $aCtrl[21][5] = 20 $aCtrl[21][1] = 8.5 * $g_iDPI_ratio2 $aCtrl[21][0] = GUICtrlCreateLabel("Icon", $aCtrl[21][2] * $g_iDPI_ratio1, $aCtrl[21][3] * $g_iDPI_ratio1, $aCtrl[21][4] * $g_iDPI_ratio1, $aCtrl[21][5] * $g_iDPI_ratio1) GUICtrlSetTip(-1, '#Region ICON - Label') GUICtrlSetFont(-1, $aCtrl[21][1] * $g_iDPI_ratio1) #EndRegion ICON #Region LIST VIEW $aCtrl[22][2] = 110 $aCtrl[22][3] = 190 $aCtrl[22][4] = 110 $aCtrl[22][5] = 80 $aCtrl[22][1] = 8.5 * $g_iDPI_ratio2 $aCtrl[22][0] = GUICtrlCreateListView("Sample|ListView|", $aCtrl[22][2] * $g_iDPI_ratio1, $aCtrl[22][3] * $g_iDPI_ratio1, $aCtrl[22][4] * $g_iDPI_ratio1, $aCtrl[22][5] * $g_iDPI_ratio1) GUICtrlSetTip(-1, '#Region LIST VIEW') GUICtrlSetFont(-1, $aCtrl[22][1] * $g_iDPI_ratio1) GUICtrlCreateListViewItem("A|One", $aCtrl[22][0]) GUICtrlCreateListViewItem("B|Two", $aCtrl[22][0]) GUICtrlCreateListViewItem("C|Three", $aCtrl[22][0]) #EndRegion LIST VIEW #Region GROUP WITH RADIO BUTTONS $aCtrl[23][2] = 230 $aCtrl[23][3] = 120 $aCtrl[23][4] = 110 $aCtrl[23][5] = 80 $aCtrl[23][1] = 8.5 * $g_iDPI_ratio2 $aCtrl[23][0] = GUICtrlCreateGroup("Sample Group", $aCtrl[23][2] * $g_iDPI_ratio1, $aCtrl[23][3] * $g_iDPI_ratio1, $aCtrl[23][4] * $g_iDPI_ratio1, $aCtrl[23][5] * $g_iDPI_ratio1) GUICtrlSetFont(-1, $aCtrl[22][1] * $g_iDPI_ratio1) $aCtrl[24][2] = 250 $aCtrl[24][3] = 140 $aCtrl[24][4] = 80 $aCtrl[24][5] = 32 $aCtrl[24][1] = 8.5 * $g_iDPI_ratio2 $aCtrl[24][0] = GUICtrlCreateRadio("Radio One", $aCtrl[24][2] * $g_iDPI_ratio1, $aCtrl[24][3] * $g_iDPI_ratio1, $aCtrl[24][4] * $g_iDPI_ratio1, $aCtrl[24][5] * $g_iDPI_ratio1) GUICtrlSetTip(-1, '#Region GROUP WITH RADIO BUTTONS- RADIO1') GUICtrlSetFont(-1, $aCtrl[24][1] * $g_iDPI_ratio1) GUICtrlSetState(-1, $GUI_CHECKED) $aCtrl[25][2] = 250 $aCtrl[25][3] = 165 $aCtrl[25][4] = 80 $aCtrl[25][5] = 32 $aCtrl[25][1] = 8.5 * $g_iDPI_ratio2 $aCtrl[25][0] = GUICtrlCreateRadio("Radio Two", $aCtrl[25][2] * $g_iDPI_ratio1, $aCtrl[25][3] * $g_iDPI_ratio1, $aCtrl[25][4] * $g_iDPI_ratio1, $aCtrl[25][5] * $g_iDPI_ratio1) GUICtrlSetTip(-1, '#Region GROUP WITH RADIO BUTTONS- RADIO2') GUICtrlSetFont(-1, $aCtrl[25][1] * $g_iDPI_ratio1) GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group #EndRegion GROUP WITH RADIO BUTTONS #Region UPDOWN $aCtrl[26][2] = 350 $aCtrl[26][3] = 113 $aCtrl[26][4] = 40 $aCtrl[26][5] = 12 $aCtrl[26][1] = 8 * $g_iDPI_ratio2 $aCtrl[26][0] = GUICtrlCreateLabel("UpDown", $aCtrl[26][2] * $g_iDPI_ratio1, $aCtrl[26][3] * $g_iDPI_ratio1, $aCtrl[26][4] * $g_iDPI_ratio1, $aCtrl[26][5] * $g_iDPI_ratio1) GUICtrlSetTip(-1, '#Region UPDOWN - Label') GUICtrlSetFont(-1, $aCtrl[26][1] * $g_iDPI_ratio1) $aCtrl[27][2] = 350 $aCtrl[27][3] = 130 $aCtrl[27][4] = 40 $aCtrl[27][5] = 20 $aCtrl[27][1] = 8.5 * $g_iDPI_ratio2 $aCtrl[27][0] = GUICtrlCreateInput("42", $aCtrl[27][2] * $g_iDPI_ratio1, $aCtrl[27][3] * $g_iDPI_ratio1, $aCtrl[27][4] * $g_iDPI_ratio1, $aCtrl[27][5] * $g_iDPI_ratio1) GUICtrlSetTip(-1, '#Region UPDOWN - Input') GUICtrlSetFont(-1, $aCtrl[27][1] * $g_iDPI_ratio1) $aCtrl[28][0] = GUICtrlCreateUpdown(-1) GUICtrlSetTip(-1, '#Region UPDOWN - Updown') #EndRegion UPDOWN #Region LABEL $aCtrl[29][2] = 350 $aCtrl[29][3] = 165 $aCtrl[29][4] = 40 $aCtrl[29][5] = 40 $aCtrl[29][1] = 8.5 * $g_iDPI_ratio2 $aCtrl[29][0] = GUICtrlCreateLabel("Green" & @CRLF & "Label", $aCtrl[29][2] * $g_iDPI_ratio1, $aCtrl[29][3] * $g_iDPI_ratio1, $aCtrl[29][4] * $g_iDPI_ratio1, $aCtrl[29][5] * $g_iDPI_ratio1) GUICtrlSetTip(-1, '#Region LABEL') GUICtrlSetBkColor(-1, 0x00FF00) GUICtrlSetFont(-1, $aCtrl[29][1] * $g_iDPI_ratio1) #EndRegion LABEL #Region SLIDER $aCtrl[30][2] = 235 $aCtrl[30][3] = 215 $aCtrl[30][4] = 40 $aCtrl[30][5] = 16 $aCtrl[30][1] = 8.5 * $g_iDPI_ratio2 $aCtrl[30][0] = GUICtrlCreateLabel("Slider:", $aCtrl[30][2] * $g_iDPI_ratio1, $aCtrl[30][3] * $g_iDPI_ratio1, $aCtrl[30][4] * $g_iDPI_ratio1, $aCtrl[30][5] * $g_iDPI_ratio1) GUICtrlSetTip(-1, '#Region SLIDER - Label') GUICtrlSetFont(-1, $aCtrl[30][1] * $g_iDPI_ratio1) $aCtrl[31][2] = 270 $aCtrl[31][3] = 210 $aCtrl[31][4] = 120 $aCtrl[31][5] = 30 $aCtrl[31][0] = GUICtrlCreateSlider($aCtrl[31][2] * $g_iDPI_ratio1, $aCtrl[31][3] * $g_iDPI_ratio1, $aCtrl[31][4] * $g_iDPI_ratio1, $aCtrl[31][5] * $g_iDPI_ratio1) GUICtrlSetTip(-1, '#Region SLIDER') GUICtrlSetData(-1, 30) #EndRegion SLIDER #Region INPUT $aCtrl[32][2] = 235 $aCtrl[32][3] = 255 $aCtrl[32][4] = 130 $aCtrl[32][5] = 20 $aCtrl[32][1] = 8.5 * $g_iDPI_ratio2 $aCtrl[32][0] = GUICtrlCreateInput("Sample Input Box", $aCtrl[32][2] * $g_iDPI_ratio1, $aCtrl[32][3] * $g_iDPI_ratio1, $aCtrl[32][4] * $g_iDPI_ratio1, $aCtrl[32][5] * $g_iDPI_ratio1) GUICtrlSetTip(-1, '#Region INPUT') GUICtrlSetFont(-1, $aCtrl[32][1] * $g_iDPI_ratio1) #EndRegion INPUT #Region DATE $aCtrl[33][2] = 5 $aCtrl[33][3] = 280 $aCtrl[33][4] = 200 $aCtrl[33][5] = 20 $aCtrl[33][1] = 8.5 * $g_iDPI_ratio2 $aCtrl[33][0] = GUICtrlCreateDate("", $aCtrl[33][2] * $g_iDPI_ratio1, $aCtrl[33][3] * $g_iDPI_ratio1, $aCtrl[33][4] * $g_iDPI_ratio1, $aCtrl[33][5] * $g_iDPI_ratio1) GUICtrlSetTip(-1, '#Region DATE') GUICtrlSetFont(-1, $aCtrl[33][1] * $g_iDPI_ratio1) $aCtrl[34][1] = 8.5 * $g_iDPI_ratio2 $aCtrl[34][2] = 10 $aCtrl[34][3] = 305 $aCtrl[34][4] = 200 $aCtrl[34][5] = 20 $aCtrl[34][0] = GUICtrlCreateLabel("(Date control expands into a calendar)", $aCtrl[34][2] * $g_iDPI_ratio1, $aCtrl[34][3] * $g_iDPI_ratio1, $aCtrl[34][4] * $g_iDPI_ratio1, $aCtrl[34][5] * $g_iDPI_ratio1) GUICtrlSetTip(-1, '#Region DATE - Label') GUICtrlSetFont(-1, $aCtrl[34][1] * $g_iDPI_ratio1) #EndRegion DATE #Region BUTTON $aCtrl[35][2] = 10 $aCtrl[35][3] = 330 $aCtrl[35][4] = 100 $aCtrl[35][5] = 30 $aCtrl[35][1] = 8.5 * $g_iDPI_ratio2 $aCtrl[35][0] = GUICtrlCreateButton("Click me :-)", $aCtrl[35][2] * $g_iDPI_ratio1, $aCtrl[35][3] * $g_iDPI_ratio1, $aCtrl[35][4] * $g_iDPI_ratio1, $aCtrl[35][5] * $g_iDPI_ratio1) GUICtrlSetTip(-1, '#Region BUTTON') GUICtrlSetFont(-1, $aCtrl[35][1] * $g_iDPI_ratio1) #EndRegion BUTTON #Region CHECKBOX $aCtrl[36][2] = 130 $aCtrl[36][3] = 335 $aCtrl[36][4] = 80 $aCtrl[36][5] = 20 $aCtrl[36][1] = 8.5 * $g_iDPI_ratio2 $aCtrl[36][0] = GUICtrlCreateCheckbox("Checkbox", $aCtrl[36][2] * $g_iDPI_ratio1, $aCtrl[36][3] * $g_iDPI_ratio1, $aCtrl[36][4] * $g_iDPI_ratio1, $aCtrl[36][5] * $g_iDPI_ratio1) GUICtrlSetTip(-1, '#Region CHECKBOX') GUICtrlSetState(-1, $GUI_CHECKED) GUICtrlSetFont(-1, $aCtrl[36][1] * $g_iDPI_ratio1) #EndRegion CHECKBOX #Region TREEVIEW ONE $aCtrl[37][2] = 210 $aCtrl[37][3] = 290 $aCtrl[37][4] = 80 $aCtrl[37][5] = 80 $aCtrl[37][1] = 8.5 * $g_iDPI_ratio2 $aCtrl[37][0] = GUICtrlCreateTreeView($aCtrl[37][2] * $g_iDPI_ratio1, $aCtrl[37][3] * $g_iDPI_ratio1, $aCtrl[37][4] * $g_iDPI_ratio1, $aCtrl[37][5] * $g_iDPI_ratio1) GUICtrlSetTip(-1, '#Region TREEVIEW ONE') GUICtrlSetFont(-1, $aCtrl[37][1] * $g_iDPI_ratio1) $aCtrl[38][0] = GUICtrlCreateTreeViewItem("TreeView", $aCtrl[37][0]) GUICtrlCreateTreeViewItem("Item1", $aCtrl[38][0]) GUICtrlCreateTreeViewItem("Item2", $aCtrl[38][0]) GUICtrlCreateTreeViewItem("Foo", -1) GUICtrlSetState($aCtrl[38][0], $GUI_EXPAND) #EndRegion TREEVIEW ONE #Region TREEVIEW TWO $aCtrl[39][2] = 295 $aCtrl[39][3] = 290 $aCtrl[39][4] = 103 $aCtrl[39][5] = 80 $aCtrl[39][1] = 8.5 * $g_iDPI_ratio2 $aCtrl[39][0] = GUICtrlCreateTreeView($aCtrl[39][2] * $g_iDPI_ratio1, $aCtrl[39][3] * $g_iDPI_ratio1, $aCtrl[39][4] * $g_iDPI_ratio1, $aCtrl[39][5] * $g_iDPI_ratio1, $TVS_CHECKBOXES) GUICtrlSetTip(-1, '#Region TREEVIEW TWO') GUICtrlSetFont(-1, $aCtrl[39][1] * $g_iDPI_ratio1) GUICtrlCreateTreeViewItem("TreeView", $aCtrl[39][0]) GUICtrlCreateTreeViewItem("With", $aCtrl[39][0]) GUICtrlCreateTreeViewItem("$TVS_CHECKBOXES", $aCtrl[39][0]) GUICtrlSetState(-1, $GUI_CHECKED) GUICtrlCreateTreeViewItem("Style", $aCtrl[39][0]) #EndRegion TREEVIEW TWO #Region GUI MESSAGE LOOP GUISetState(@SW_SHOW) If @OSBuild > 9599 Then GUIRegisterMsg($WM_DPICHANGED, "WM_DPICHANGED") ;requires Win 8.1+ / Server 2012 R2+ GUIRegisterMsg($WM_GETMINMAXINFO, "WM_GETMINMAXINFO") GUIRegisterMsg($WM_SIZE, "WM_SIZE") Local $hGUI_child, $hImage, $hGDIBitmap, $hGfx, $hPath, $hFamily, $hFormat, $tLayout, $hPen, $hBrush, $hB, $aGUIGetMsg _GDIPlus_Startup() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE _GDIPlus_PathDispose($hPath) _GDIPlus_PenDispose($hPen) _GDIPlus_BrushDispose($hBrush) _GDIPlus_FontFamilyDispose($hFamily) _GDIPlus_StringFormatDispose($hFormat) _GDIPlus_ImageDispose ($hImage) _GDIPlus_GraphicsDispose($hGfx) _GDIPlus_Shutdown() GUIRegisterMsg($WM_DPICHANGED, "") GUIRegisterMsg(WM_GETMINMAXINFO, "") GUIRegisterMsg(WM_SIZE, "") GUIDelete() Exit Case $aCtrl[35][0] If $hImage Then $hImage = _GDIPlus_ImageDispose($hImage) $hImage = _GDIPlus_BitmapCreateFromScan0($iw * $g_iDPI_ratio1, $ih * $g_iDPI_ratio1) If $hGfx Then _GDIPlus_GraphicsDispose($hGfx) $hGfx = _GDIPlus_ImageGetGraphicsContext($hImage) _GDIPlus_GraphicsSetTextRenderingHint($hGfx, $GDIP_TEXTRENDERINGHINTANTIALIAS) _GDIPlus_GraphicsSetSmoothingMode($hGfx, $GDIP_SMOOTHINGMODE_HIGHQUALITY) _GDIPlus_GraphicsClear($hGfx, 0xFFF0F0F0) If $hPath Then _GDIPlus_PathDispose($hPath) $hPath = _GDIPlus_PathCreate() If $hFamily Then _GDIPlus_FontFamilyDispose($hFamily) $hFamily = _GDIPlus_FontFamilyCreate("Arial") If $hFormat Then _GDIPlus_StringFormatDispose($hFormat) $hFormat = _GDIPlus_StringFormatCreate() _GDIPlus_StringFormatSetAlign($hFormat, 1) _GDIPlus_StringFormatSetLineAlign($hFormat, 1) $tLayout = _GDIPlus_RectFCreate(0, 0, $iw * $g_iDPI_ratio1, $ih * $g_iDPI_ratio1) _GDIPlus_PathAddString($hPath, "Hello World!", $tLayout, $hFamily, 0, 50 * $g_iDPI_ratio1, $hFormat) If $hPen Then _GDIPlus_PenDispose($hPen) $hPen = _GDIPlus_PenCreate(0xFF000000, 8) _GDIPlus_PenSetLineJoin($hPen, 2) _GDIPlus_GraphicsDrawPath($hGfx, $hPath, $hPen) If $hBrush Then _GDIPlus_BrushDispose($hBrush) $hBrush = _GDIPlus_BrushCreateSolid(0xFF00FF00) _GDIPlus_GraphicsFillPath($hGfx, $hPath, $hBrush) If $hGDIBitmap Then _WinAPI_DeleteObject($hGDIBitmap) $hGDIBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImage) Local $aGUI_Pos = WinGetPos($ahWnd[0][0]) $ahWnd[1][0] = GUICreate("GDI+ Child Window", $iw * $g_iDPI_ratio1, $ih * $g_iDPI_ratio1, $aGUI_Pos[0] - ($aGUI_Pos[2] - $iw * $g_iDPI_ratio1) / 2, $aGUI_Pos[1] + $ih * $g_iDPI_ratio1 / 2, $WS_SIZEBOX, -1, $ahWnd[0][0]) $aCtrl[40][2] = 0 $aCtrl[40][3] = 0 $aCtrl[40][4] = $iw $aCtrl[40][5] = $ih $aCtrl[40][0] = GUICtrlCreatePic("", $aCtrl[40][2], $aCtrl[40][3], $aCtrl[40][4] * $g_iDPI_ratio1, $aCtrl[40][5] * $g_iDPI_ratio1) _WinAPI_DeleteObject(GUICtrlSendMsg($aCtrl[40][0], $STM_SETIMAGE, $IMAGE_BITMAP, $hGDIBitmap)) GUISetState(@SW_SHOW, $ahWnd[1][0]) While 1 $aGUIGetMsg = GUIGetMsg(1) Switch $aGUIGetMsg[1] Case $ahWnd[1][0] Switch $aGUIGetMsg[0] Case $GUI_EVENT_CLOSE GUIDelete($ahWnd[1][0]) ExitLoop EndSwitch EndSwitch WEnd EndSwitch WEnd #EndRegion GUI MESSAGE LOOP EndFunc ;==>_Example Func WM_SIZE($hWnd, $iMsg, $wParam, $lParam) #forceref $iMsg, $wParam, $lParam Switch $hWnd Case $ahWnd[1][0] Local $aSize = ControlGetPos($ahWnd[1][0], "", $aCtrl[40][0]) $aCtrl[40][2] = $aSize[0] $aCtrl[40][3] = $aSize[1] $aCtrl[40][4] = _WinAPI_LoWord($lParam) $aCtrl[40][5] = _WinAPI_HiWord($lParam) GUICtrlSetPos($aCtrl[40][0], $aCtrl[40][2], $aCtrl[40][3], $aCtrl[40][4], $aCtrl[40][5]) EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>WM_SIZE Func WM_GETMINMAXINFO($hWnd, $Msg, $wParam, $lParam) If $hWnd = $ahWnd[1][0] Then Local $minmaxinfo = DllStructCreate("long ptReservedX;long ptReservedY;long ptMaxSizeX; long ptMaxSizeY;long ptMaxPositionX;long ptMaxPositionY;long ptMinTrackSizeX;long ptMinTrackSizeY;long ptMaxTrackSizeX;long ptMaxTrackSizeY ", $lParam) $minmaxinfo.ptMinTrackSizeX = $iw / 2 $minmaxinfo.ptMinTrackSizeY = $ih / 2 $minmaxinfo.ptMaxTrackSizeX = $iw * 3 $minmaxinfo.ptMaxTrackSizeY = $ih * 3 EndIf Return "GUI_RUNDEFMSG" EndFunc ;==>WM_GETMINMAXINFO Func WM_DPICHANGED($hWnd, $iMsg, $wParam, $lParam) #forceref $iMsg Local $iDPI = _WinAPI_LoWord($wParam) ConsoleWrite("DPI change triggered! DPI: " & $iDPI & @CRLF) $g_iDPI_ratio1 = $iDPI / 96 $g_iDPI_ratio2 = $g_iDPI_ratio1 ^ -1 Local $tRECT = DllStructCreate($tagRECT, $lParam) Local $iX = $tRECT.left, $iY = $tRECT.top, $iW = $tRECT.right - $iX, $iH = $tRECT.bottom - $iY, $i Switch $hWnd Case $ahWnd[0][0] _WinAPI_SetWindowPos($ahWnd[0][0], 0, $iX, $iY, $iW, $iH, BitOR($SWP_NOZORDER, $SWP_NOACTIVATE)) For $i = 0 To 39 If $aCtrl[$i][1] Then GUICtrlSetFont($aCtrl[$i][0], $aCtrl[$i][1] * $g_iDPI_ratio1) If $aCtrl[$i][4] Then GUICtrlSetPos($aCtrl[$i][0], $aCtrl[$i][2] * $g_iDPI_ratio1, $aCtrl[$i][3] * $g_iDPI_ratio1, $aCtrl[$i][4] * $g_iDPI_ratio1, $aCtrl[$i][5] * $g_iDPI_ratio1) Next _WinAPI_UpdateWindow($ahWnd[0][0]) Case $ahWnd[1][0] $i = 40 _WinAPI_SetWindowPos($ahWnd[1][0], 0, $iX, $iY, $iW, $iH, BitOR($SWP_NOZORDER, $SWP_NOACTIVATE)) GUICtrlSetPos($aCtrl[$i][0], $aCtrl[$i][2], $aCtrl[$i][3], $aCtrl[$i][4], $aCtrl[$i][5]) _WinAPI_UpdateWindow($ahWnd[1][0]) EndSwitch Return 1 EndFunc ;==>WM_DPICHANGED  
    THX.
  14. Like
    UEZ reacted to Numeric1 in GDI+ and Taskbar Overlay Icon   
    You can simply try this code:
    It uses GDI+ to draw a red circle with centered text, creates a 32-bit ARGB icon, and sets it as a taskbar overlay using ITaskbarList3::SetOverlayIcon.
    It updates the icon every second. You can easily adjust it to fit your own needs.
    Let me know if it works for you!
    #include <GDIPlus.au3> #include <GUIConstantsEx.au3> #include <WinAPIIcons.au3> Global $oError = ObjEvent("AutoIt.Error", "_ErrFunc") Func _ErrFunc() ConsoleWrite("! COM Error ! Number: 0x" & Hex($oError.number, 8) & " Line: " & $oError.scriptline & " - " & $oError.windescription & @CRLF) EndFunc ; Define ITaskbarList3 COM interface Global Const $sCLSID_TaskbarList = "{56FDF344-FD6D-11D0-958A-006097C9A090}" Global Const $sIID_ITaskbarList3 = "{EA1AFB91-9E28-4B86-90E9-9E9F8A5EEFAF}" Global Const $tagITaskbarList3 = _ "HrInit hresult();" & _ "AddTab hresult(hwnd);" & _ "DeleteTab hresult(hwnd);" & _ "ActivateTab hresult(hwnd);" & _ "SetActiveAlt hresult(hwnd);" & _ "MarkFullscreenWindow hresult(hwnd;boolean);" & _ "SetProgressValue hresult(hwnd;uint64;uint64);" & _ "SetProgressState hresult(hwnd;int);" & _ "RegisterTab hresult(hwnd;hwnd);" & _ "UnregisterTab hresult(hwnd);" & _ "SetTabOrder hresult(hwnd;hwnd);" & _ "SetTabActive hresult(hwnd;hwnd;dword);" & _ "ThumbBarAddButtons hresult(hwnd;uint;ptr);" & _ "ThumbBarUpdateButtons hresult(hwnd;uint;ptr);" & _ "ThumbBarSetImageList hresult(hwnd;ptr);" & _ "SetOverlayIcon hresult(hwnd;ptr;wstr);" & _ "SetThumbnailTooltip hresult(hwnd;wstr);" & _ "SetThumbnailClip hresult(hwnd;ptr);" ; Global variables Global $hGraphic, $hTextBrush, $hFormat, $hFamily, $hFont, $hBackgroundBrush, $hPen Global $oList, $hWnd Global $iWidth = 32, $iHeight = 32, $iFontSize = 12 Global $iCounter = 0 Main() Func Main() _GDIPlus_Startup() $hWnd = GUICreate("Taskbar Overlay Icon Test", 400, 300) Local $label = GUICtrlCreateLabel("Starting...", 10, 10, 380, 100) GUISetState() $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hWnd) $hTextBrush = _GDIPlus_BrushCreateSolid(0xFFFFFFFF) $hFormat = _GDIPlus_StringFormatCreate() $hFamily = _GDIPlus_FontFamilyCreate("Arial") $hFont = _GDIPlus_FontCreate($hFamily, $iFontSize) $hBackgroundBrush = _GDIPlus_BrushCreateSolid(0xFFFF0000) $hPen = _GDIPlus_PenCreate(0xFF000000, 2) $oList = ObjCreateInterface($sCLSID_TaskbarList, $sIID_ITaskbarList3, $tagITaskbarList3) If Not IsObj($oList) Then MsgBox(16, "Error", "Failed to initialize ITaskbarList3.") Exit EndIf $oList.HrInit() If @error Then MsgBox(16, "Error", "HrInit failed: " & @error) Exit EndIf GUICtrlSetData($label, "$oList.AddTab") $oList.AddTab($hWnd) If @error Then MsgBox(16, "Error", "Failed to add taskbar tab: " & @error) Exit EndIf _UpdateOverlayIcon($iCounter) GUICtrlSetData($label, "Overlay icon initialized with counter: " & $iCounter) Local $hTimer = TimerInit() While 1 If TimerDiff($hTimer) > 1000 Then $iCounter += 1 If $iCounter > 99 Then $iCounter = 99 _UpdateOverlayIcon($iCounter) GUICtrlSetData($label, "Counter: " & $iCounter) $hTimer = TimerInit() EndIf If GUIGetMsg() = $GUI_EVENT_CLOSE Then ExitLoop Sleep(10) WEnd GUICtrlSetData($label, "Removing overlay icon and tab") _Taskbar_SetOverlayIcon($oList, $hWnd, Null, "") $oList.DeleteTab($hWnd) $oList = 0 _GDIPlus_FontDispose($hFont) _GDIPlus_PenDispose($hPen) _GDIPlus_FontFamilyDispose($hFamily) _GDIPlus_StringFormatDispose($hFormat) _GDIPlus_BrushDispose($hTextBrush) _GDIPlus_BrushDispose($hBackgroundBrush) _GDIPlus_GraphicsDispose($hGraphic) _GDIPlus_Shutdown() EndFunc Func _UpdateOverlayIcon($iCount) Local $hBitmap = _GDIPlus_BitmapCreateFromScan0($iWidth, $iHeight, $GDIP_PXF32ARGB) Local $hGraphicBitmap = _GDIPlus_ImageGetGraphicsContext($hBitmap) _GDIPlus_GraphicsSetSmoothingMode($hGraphicBitmap, 2) _GDIPlus_GraphicsClear($hGraphicBitmap, 0x00000000) _GDIPlus_GraphicsFillEllipse($hGraphicBitmap, 0, 0, $iWidth - 2, $iHeight - 2, $hBackgroundBrush) _GDIPlus_GraphicsDrawEllipse($hGraphicBitmap, 0, 0, $iWidth - 2, $iHeight - 2, $hPen) Local $tLayout = _GDIPlus_RectFCreate(2, 2, $iWidth - 4, $iHeight - 8) DrawStringCentered($hGraphicBitmap, $iCount, $hFont, $tLayout, $hFormat, $hTextBrush) Local $hIcon = _GDIPlus_HICONCreateFromBitmap($hBitmap) If @error Then MsgBox(16, "Error", "Failed to create HICON: " & @error) Exit EndIf _Taskbar_SetOverlayIcon($oList, $hWnd, $hIcon, "Counter: " & $iCount) _WinAPI_DestroyIcon($hIcon) _GDIPlus_BitmapDispose($hBitmap) _GDIPlus_GraphicsDispose($hGraphicBitmap) EndFunc Func DrawStringCentered($hGraphic, $iIndex, $hFont, $tLayout, $hFormat, $hTextBrush) Local $aInfo = _GDIPlus_GraphicsMeasureString($hGraphic, $iIndex, $hFont, $tLayout, $hFormat) Local $tIndex = $aInfo[0] $tIndex.X = $tLayout.X + (($tLayout.Width - $tIndex.Width) / 2) $tIndex.Y = $tLayout.Y + (($tLayout.Height - _GDIPlus_FontGetHeight($hFont, $hGraphic)) / 2) _GDIPlus_GraphicsDrawStringEx($hGraphic, $iIndex, $hFont, $tIndex, $hFormat, $hTextBrush) EndFunc Func _Taskbar_SetOverlayIcon(ByRef $oTB, $hWnd, $hIcon, $sAltText = "") Local $vRet = $oTB.SetOverlayIcon($hWnd, $hIcon, $sAltText) If @error Then Return SetError(@error, @extended, False) If $vRet = 0 Then Return True Return SetError($vRet, 0, False) EndFunc  
  15. Like
    UEZ got a reaction from argumentum in WebP v0.3.7 build 2025-07-03 beta   
    Updated to: WebP v0.3.5 build 2025-06-27 beta
    You can now create WebP animated files.
    Examples8 encodes GDI+ supported image files to an animation.
    Example9 captures the desktop screen to an WebP anim file.
     
  16. Like
    UEZ got a reaction from KaFu in WebP v0.3.7 build 2025-07-03 beta   
    Updated to: WebP v0.3.5 build 2025-06-27 beta
    You can now create WebP animated files.
    Examples8 encodes GDI+ supported image files to an animation.
    Example9 captures the desktop screen to an WebP anim file.
     
  17. Like
    UEZ got a reaction from Davidyese in Make active transparent icon on image background   
    Fixed.
  18. Like
    UEZ got a reaction from argumentum in Make active transparent icon on image background   
    I have thought again and this is simpler and the better solution.
    #NoTrayIcon ;#RequireAdmin #include <WinAPISys.au3> #include <GDIPlus.au3> #include <WinAPIShellEx.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <ButtonConstants.au3> #include <StaticConstants.au3> Example() Func Example() Local $hGUI, $hGraphic, $hIcon, $hBitmap, $iX = 768, $iY = 525 $hGUI = GUICreate("GDI+", $iX, $iY) _GDIPlus_Startup() ; Create GUI Global $idPic = GUICtrlCreatePic("", 0, 0, $iX, $iY) Global $sFileName = @ScriptDir& "\MAIN.png" $hImage = _GDIPlus_ImageLoadFromFile($sFileName) $iX = _GDIPlus_ImageGetWidth($hImage) $iY = _GDIPlus_ImageGetHeight($hImage) $hBGImage = _GDIPlus_BitmapCreateFromScan0($iX, $iY) $hGraphic = _GDIPlus_ImageGetGraphicsContext($hBGImage) _GDIPlus_GraphicsDrawImage($hGraphic, $hImage, 0, 0) $btnx = 250 $btny = 150 ;_GDIPlus_GraphicsClear($hGraphic, 0xFFFFFFFF) $hIcon = _WinAPI_ShellExtractIcon(@SystemDir & '\shell32.dll', 221, 48, 48) $hBitmap = _GDIPlus_BitmapCreateFromHICON32($hIcon) _GDIPlus_GraphicsDrawImage($hGraphic, $hBitmap, $btnx, $btny) $shBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBGImage) _WinAPI_DeleteObject(GUICtrlSendMsg($idPic, 0x0172, 0, $shBitmap)) ; STM_SETIMAGE = 0x0172, $IMAGE_BITMAP = 0 GUICtrlSetState($idPic, $gui_disable) GUICtrlSetState(-1, $GUI_ONTOP) GUICtrlSetCursor(-1, 0) $hIcon = GUICtrlCreateIcon(@SystemDir & '\shell32.dll', -1, $btnx, $btny, 48, 48, BitOR($SS_NOTIFY, $SS_BLACKRECT)) GUISetState() ; Loop until user exits Do Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $hIcon ConsoleWrite("Icon clicked" & @CRLF) EndSwitch Until False ; Clean up resources _WinAPI_DestroyIcon($hIcon) _WinAPI_DeleteObject($shBitmap) _GDIPlus_BitmapDispose($hImage) _GDIPlus_BitmapDispose($hBGImage) _GDIPlus_BitmapDispose($hBitmap) _GDIPlus_GraphicsDispose($hGraphic) _GDIPlus_Shutdown() EndFunc ;==>Example  
  19. Thanks
    UEZ reacted to Werty in Make active transparent icon on image background   
    I dont see $btny used anywhere, $btnx appears to be used for both X and Y positions.
  20. Like
    UEZ got a reaction from Davidyese in Make active transparent icon on image background   
    I have thought again and this is simpler and the better solution.
    #NoTrayIcon ;#RequireAdmin #include <WinAPISys.au3> #include <GDIPlus.au3> #include <WinAPIShellEx.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <ButtonConstants.au3> #include <StaticConstants.au3> Example() Func Example() Local $hGUI, $hGraphic, $hIcon, $hBitmap, $iX = 768, $iY = 525 $hGUI = GUICreate("GDI+", $iX, $iY) _GDIPlus_Startup() ; Create GUI Global $idPic = GUICtrlCreatePic("", 0, 0, $iX, $iY) Global $sFileName = @ScriptDir& "\MAIN.png" $hImage = _GDIPlus_ImageLoadFromFile($sFileName) $iX = _GDIPlus_ImageGetWidth($hImage) $iY = _GDIPlus_ImageGetHeight($hImage) $hBGImage = _GDIPlus_BitmapCreateFromScan0($iX, $iY) $hGraphic = _GDIPlus_ImageGetGraphicsContext($hBGImage) _GDIPlus_GraphicsDrawImage($hGraphic, $hImage, 0, 0) $btnx = 250 $btny = 150 ;_GDIPlus_GraphicsClear($hGraphic, 0xFFFFFFFF) $hIcon = _WinAPI_ShellExtractIcon(@SystemDir & '\shell32.dll', 221, 48, 48) $hBitmap = _GDIPlus_BitmapCreateFromHICON32($hIcon) _GDIPlus_GraphicsDrawImage($hGraphic, $hBitmap, $btnx, $btny) $shBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBGImage) _WinAPI_DeleteObject(GUICtrlSendMsg($idPic, 0x0172, 0, $shBitmap)) ; STM_SETIMAGE = 0x0172, $IMAGE_BITMAP = 0 GUICtrlSetState($idPic, $gui_disable) GUICtrlSetState(-1, $GUI_ONTOP) GUICtrlSetCursor(-1, 0) $hIcon = GUICtrlCreateIcon(@SystemDir & '\shell32.dll', -1, $btnx, $btny, 48, 48, BitOR($SS_NOTIFY, $SS_BLACKRECT)) GUISetState() ; Loop until user exits Do Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $hIcon ConsoleWrite("Icon clicked" & @CRLF) EndSwitch Until False ; Clean up resources _WinAPI_DestroyIcon($hIcon) _WinAPI_DeleteObject($shBitmap) _GDIPlus_BitmapDispose($hImage) _GDIPlus_BitmapDispose($hBGImage) _GDIPlus_BitmapDispose($hBitmap) _GDIPlus_GraphicsDispose($hGraphic) _GDIPlus_Shutdown() EndFunc ;==>Example  
  21. Like
    UEZ got a reaction from pixelsearch in Make active transparent icon on image background   
    I have thought again and this is simpler and the better solution.
    #NoTrayIcon ;#RequireAdmin #include <WinAPISys.au3> #include <GDIPlus.au3> #include <WinAPIShellEx.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <ButtonConstants.au3> #include <StaticConstants.au3> Example() Func Example() Local $hGUI, $hGraphic, $hIcon, $hBitmap, $iX = 768, $iY = 525 $hGUI = GUICreate("GDI+", $iX, $iY) _GDIPlus_Startup() ; Create GUI Global $idPic = GUICtrlCreatePic("", 0, 0, $iX, $iY) Global $sFileName = @ScriptDir& "\MAIN.png" $hImage = _GDIPlus_ImageLoadFromFile($sFileName) $iX = _GDIPlus_ImageGetWidth($hImage) $iY = _GDIPlus_ImageGetHeight($hImage) $hBGImage = _GDIPlus_BitmapCreateFromScan0($iX, $iY) $hGraphic = _GDIPlus_ImageGetGraphicsContext($hBGImage) _GDIPlus_GraphicsDrawImage($hGraphic, $hImage, 0, 0) $btnx = 250 $btny = 150 ;_GDIPlus_GraphicsClear($hGraphic, 0xFFFFFFFF) $hIcon = _WinAPI_ShellExtractIcon(@SystemDir & '\shell32.dll', 221, 48, 48) $hBitmap = _GDIPlus_BitmapCreateFromHICON32($hIcon) _GDIPlus_GraphicsDrawImage($hGraphic, $hBitmap, $btnx, $btny) $shBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBGImage) _WinAPI_DeleteObject(GUICtrlSendMsg($idPic, 0x0172, 0, $shBitmap)) ; STM_SETIMAGE = 0x0172, $IMAGE_BITMAP = 0 GUICtrlSetState($idPic, $gui_disable) GUICtrlSetState(-1, $GUI_ONTOP) GUICtrlSetCursor(-1, 0) $hIcon = GUICtrlCreateIcon(@SystemDir & '\shell32.dll', -1, $btnx, $btny, 48, 48, BitOR($SS_NOTIFY, $SS_BLACKRECT)) GUISetState() ; Loop until user exits Do Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $hIcon ConsoleWrite("Icon clicked" & @CRLF) EndSwitch Until False ; Clean up resources _WinAPI_DestroyIcon($hIcon) _WinAPI_DeleteObject($shBitmap) _GDIPlus_BitmapDispose($hImage) _GDIPlus_BitmapDispose($hBGImage) _GDIPlus_BitmapDispose($hBitmap) _GDIPlus_GraphicsDispose($hGraphic) _GDIPlus_Shutdown() EndFunc ;==>Example  
  22. Like
    UEZ got a reaction from Davidyese in Make active transparent icon on image background   
    You have to exclude the area of the icon off the bitmap (graphic).
    One example:
     
  23. Like
    UEZ got a reaction from WildByDesign in Need help converting percentage to hex   
    I misunderstood the value but it's easy, too:
    Local $iIntensity = '80' ;% of the alpha channel Local $iTintColor = '0x0078D4' $iIntensity = Int($iIntensity) * 255 / 100 Local $iColor = BitOR(BitShift($iIntensity > 255 ? 255 : $iIntensity < 0 ? 0: $iIntensity, -24), Int($iTintColor)) ConsoleWrite(Hex($iColor, 8) & @CRLF) _WinAPI_DwmEnableBlurBehindWindow10($hGUI, True, $iColor)  
  24. Like
    UEZ got a reaction from argumentum in Need help converting percentage to hex   
    I misunderstood the value but it's easy, too:
    Local $iIntensity = '80' ;% of the alpha channel Local $iTintColor = '0x0078D4' $iIntensity = Int($iIntensity) * 255 / 100 Local $iColor = BitOR(BitShift($iIntensity > 255 ? 255 : $iIntensity < 0 ? 0: $iIntensity, -24), Int($iTintColor)) ConsoleWrite(Hex($iColor, 8) & @CRLF) _WinAPI_DwmEnableBlurBehindWindow10($hGUI, True, $iColor)  
  25. Like
    UEZ got a reaction from WildByDesign in Need help converting percentage to hex   
    Try:
    Local $iIntensity = '80' ;hex Local $iTintColor = '0x0078D4' Local $iColor = BitOR(BitShift(Dec($iIntensity), -24), Int($iTintColor)) ConsoleWrite(Hex($iColor, 8) & @CRLF) _WinAPI_DwmEnableBlurBehindWindow10($hGUI, True, $iColor)  
×
×
  • Create New...