Search the Community
Showing results for tags 'gui hole radius'.
-
I can create a hole in a semi transparent gui but I don't know how to create a rounded rectangle hole. I need this shape: See my two examples Example one: #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <winapi.au3> $hGUI = GUICreate("a",1000,800,100,100,-1,$WS_EX_LAYERED);can be $WS_POPUP GUISetBkColor(0x0000) ; will change background color ;~ WinSetTrans($hGUI,"",100) GUISetState() _WinAPI_SetLayeredWindowAttributes($hGUI, 0xABCDEF, 100) $g1 = GUICtrlCreateGraphic(0,0,0,0) GUICtrlSetGraphic(-1,$GUI_GR_COLOR,0xABCDEF,0xABCDEF) ;~ GUICtrlSetGraphic(-1, $GUI_GR_ELLIPSE, 0, 0, 100, 30, 10) GUICtrlSetGraphic(-1, $GUI_GR_RECT, 100, 100, 100, 30) GUICtrlSetGraphic(-1, $GUI_GR_REFRESH) While 1 If GUIGetMsg() = $GUI_EVENT_CLOSE Then Exit Wend Example two: #include <winapi.au3> #include <WinAPIGdi.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $hGUI = GUICreate("Test", 500, 500) GUISetBkColor(0x0000) WinSetTrans($hGUI,"",100) _GUICreateInvRect($hGUI, 50, 50, 80, 30) GUISetState() While 1 If GUIGetMsg() = $GUI_EVENT_CLOSE Then Exit Wend Func _GUICreateInvRect($hWnd, $iX, $iY, $iW, $iH) $aPos = WinGetPos($hWnd) Local $hMask_1 = _WinAPI_CreateRectRgn(0, 0, $aPos[2], $iY) Local $hMask_2 = _WinAPI_CreateRectRgn(0, 0, $iX, $aPos[3]) Local $hMask_3 = _WinAPI_CreateRectRgn($iX + $iW, 0, $aPos[2], $aPos[3]) Local $hMask_4 = _WinAPI_CreateRectRgn(0, $iY + $iH, $aPos[2], $aPos[3]) _WinAPI_CombineRgn($hMask_1, $hMask_1, $hMask_2, 2) _WinAPI_CombineRgn($hMask_1, $hMask_1, $hMask_3, 2) _WinAPI_CombineRgn($hMask_1, $hMask_1, $hMask_4, 2) _WinAPI_DeleteObject($hMask_2) _WinAPI_DeleteObject($hMask_3) _WinAPI_DeleteObject($hMask_4) _WinAPI_SetWindowRgn($hWnd, $hMask_1, 1) EndFunc Thanks in advance.