Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <GUIConstants.au3>
- #include <GDIPlus.au3>
- ; -Author: name22 (www.autoit.de)
- $hWnd = GUICreate("Example by name22", 400, 400)
- $cDummy_Start = GUICtrlCreateDummy()
- $cButton1 = GUICtrlCreateButton("Button 1", 50, 50, 100, 50)
- $cButton2 = GUICtrlCreateButton("Button 2", 70, 200, 100, 50)
- $cDummy_End = GUICtrlCreateDummy()
- GUISetState()
- _GDIPlus_Startup()
- $hGraphics = _GDIPlus_GraphicsCreateFromHWND($hWnd)
- _GDIPlus_GraphicsSetSmoothingMode($hGraphics, 2)
- For $i = $cDummy_Start + 1 To $cDummy_End - 1
- $aPos = ControlGetPos($hWnd, "", $i)
- ConsoleWrite($aPos[0] & @CRLF)
- _GDIPlus_GraphicsSetClipRect($hGraphics, $aPos[0], $aPos[1], $aPos[2], $aPos[3], 3)
- Next
- _GDIPlus_GraphicsFillEllipse($hGraphics, 20, 20, 300, 300)
- While True
- Switch GUIGetMsg()
- Case $GUI_EVENT_CLOSE
- Exit
- Case $cButton1
- MsgBox(64, "Click", "Button 1")
- Case $cButton2
- MsgBox(64, "Click", "Button 2")
- EndSwitch
- WEnd
- ; #FUNCTION# ====================================================================================================================
- ; Name...........: _GDIPlus_GraphicsSetClipRect
- ; Description ...: Updates the clipping region of a Graphics object to a region that is the combination of itself and a rectangle
- ; Syntax.........: _GDIPlus_GraphicsSetClipRect($hGraphics, $nX, $nY, $nWidth, $nHeight[, $iCombineMode = 0])
- ; Parameters ....: $hGraphics - Pointer to a Graphics object
- ; $nX - X coordinate of the upper-left corner of the rectangle
- ; $nY - Y coordinate of the upper-left corner of the rectangle
- ; $nWidth - Width of the rectangle
- ; $nHeight - Height of the rectangle
- ; $iCombineMode - Regions combination mode:
- ; |0 - The existing region is replaced by the new region
- ; |1 - The existing region is replaced by the intersection of itself and the new region
- ; |2 - The existing region is replaced by the union of itself and the new region
- ; |3 - The existing region is replaced by the result of performing an XOR on the two regions
- ; |4 - The existing region is replaced by the portion of itself that is outside of the new region
- ; |5 - The existing region is replaced by the portion of the new region that is outside of the existing region
- ; Return values .: Success - True
- ; Failure - False and either:
- ; |@error and @extended are set if DllCall failed
- ; |$GDIP_STATUS contains a non zero value specifying the error code
- ; Remarks .......: None
- ; Related .......: None
- ; Link ..........; @@MsdnLink@@ GdipSetClipRect
- ; Example .......; No
- ; ===============================================================================================================================
- Func _GDIPlus_GraphicsSetClipRect($hGraphics, $nX, $nY, $nWidth, $nHeight, $iCombineMode = 0)
- Local $aResult = DllCall($ghGDIPDll, "uint", "GdipSetClipRect", "hwnd", $hGraphics, "float", $nX, "float", $nY, "float", $nWidth, "float", $nHeight, "int", $iCombineMode)
- If @error Then Return SetError(@error, @extended, False)
- $GDIP_STATUS = $aResult[0]
- Return $aResult[0] = 0
- EndFunc ;==>_GDIPlus_GraphicsSetClipRect
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement