Modify

Opened 15 years ago

Closed 15 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 Changed 15 years ago by Jon

  • Milestone set to 3.3.5.4
  • Owner set to Jon
  • Resolution set to Fixed
  • Status changed from new to closed

Fixed by revision [5671] in version: 3.3.5.4

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 owner will remain Jon.
Author


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

 
Note: See TracTickets for help on using tickets.