Modify

Opened 16 years ago

Closed 16 years ago

#1446 closed Bug (Fixed)

_Screencapture_Capture UDF height and width is 1 pixel off

Reported by: djbarnes@… Owned by: Jon
Milestone: 3.3.5.4 Component: AutoIt
Version: 3.3.4.0 Severity: None
Keywords: screencapture Cc:

Description

Screencapture_capture will return a square that is 1 pixel too small both in width and in height.

Imagine a grid of pixels 3x3. You want to capture pixel 1,1 - 3,3.
so you run the command:
_ScreenCapture_Capture ("example.png",1,1,3,3)
however, in _ScreenCapture_Capture the following code exists:

Local $iW = $iRight - $iLeft
Local $iH = $iBottom - $iTop

so $iW = 3-1 = 2

$iH = 3-1 = 2

returning an image 2x2, which isn't what you want. The rectangle is inclusive of the last pixels.

recommended fix:

Local $iW = $iRight - $iLeft + 1
Local $iH = $iBottom - $iTop + 1

Although this bug is minor, If you are doing pixelchecksum and using Screencapture_capture to test your code this can cause hours of headaches!

Attachments (0)

Change History (1)

comment:1 by Jon, 16 years ago

Milestone: 3.3.5.4
Owner: set to Jon
Resolution: Fixed
Status: newclosed

Fixed by revision [5671] in version: 3.3.5.4

Modify Ticket

Action
as closed The owner will remain Jon.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.