Modify

Opened 9 years ago

Closed 8 years ago

#1977 closed Bug (No Bug)

_ScreenCapture_CaptureWnd - wrong capture on maximized window

Reported by: MrCreatoR <mscreator@…> Owned by:
Milestone: Component: Standard UDFs
Version: 3.3.6.1 Severity: None
Keywords: Cc:

Description

Whe we use _ScreenCapture_CaptureWnd on maximized window, there is extra pixels that should not be captured (it's the size of the window borders).

The fix is simple, just calculate the size of the border of specified window in case it's maximized:

Func _ScreenCapture_CaptureWnd($sFileName, $hWnd, $iLeft = 0, $iTop = 0, $iRight = -1, $iBottom = -1, $fCursor = True)
	Local $tRect = _WinAPI_GetWindowRect($hWnd)
	Local $aWinClientSize, $aWinPos, $iBorder
	
	If BitAND(WinGetState($hWnd), 32) Then ;windows is maximized
		$aWinClientSize = WinGetClientSize($hWnd)
		$aWinPos = WinGetPos($hWnd)
		If Not @error Then $iBorder = ($aWinPos[2] - $aWinClientSize[0]) / 2
	EndIf
	
	$iLeft += DllStructGetData($tRect, "Left") + $iBorder
	$iTop += DllStructGetData($tRect, "Top") + $iBorder
	If $iRight = -1 Then $iRight = DllStructGetData($tRect, "Right") - DllStructGetData($tRect, "Left") - $iBorder
	If $iBottom = -1 Then $iBottom = DllStructGetData($tRect, "Bottom") - DllStructGetData($tRect, "Top") - $iBorder
	....
EndFunc

Attachments (0)

Change History (3)

comment:1 Changed 9 years ago by MrCreatoR <mscreator@…>

One small correction, the $iBorder initialy should be = 1 (Local ..., $iBoderd = 1), because when capturing not maximized window, it's also captured with extra pixels, it's probably the same issue as it was with _ScreenCapture_Capture.

comment:2 Changed 8 years ago by trancexx

  • Component changed from AutoIt to Standard UDFs

comment:3 Changed 8 years ago by guinness

  • Resolution set to No Bug
  • Status changed from new to closed

Fixed in Rev [5806] for Trac Ticket #1614.

Please use the latest stable release.

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

Action
as closed The ticket will remain with no owner.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.