Skip to content

Commit

Permalink
generate imagegrabwindow (#302)
Browse files Browse the repository at this point in the history
  • Loading branch information
dbrekelmans authored Oct 16, 2021
1 parent ae3b296 commit c1748a0
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 1 deletion.
1 change: 1 addition & 0 deletions generated/functionsList.php
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,7 @@
'imagegd2',
'imagegif',
'imagegrabscreen',
'imagegrabwindow',
'imagejpeg',
'imagelayereffect',
'imageline',
Expand Down
20 changes: 20 additions & 0 deletions generated/image.php
Original file line number Diff line number Diff line change
Expand Up @@ -1845,6 +1845,26 @@ function imagegrabscreen()
}


/**
* Grabs a window or its client area using a windows handle (HWND property in COM instance)
*
* @param int $handle The HWND window ID.
* @param bool $client_area Include the client area of the application window.
* @return \GdImage Returns an image object on success, FALSE on failure.
* @throws ImageException
*
*/
function imagegrabwindow(int $handle, bool $client_area = false): \GdImage
{
error_clear_last();
$result = \imagegrabwindow($handle, $client_area);
if ($result === false) {
throw ImageException::createFromPhpError();
}
return $result;
}


/**
* imagejpeg creates a JPEG file from
* the given image.
Expand Down
1 change: 0 additions & 1 deletion generator/config/ignoredFunctions.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,4 @@
'apcu_delete', // apcu_delete returns false when the $key does not exist in the cache store
'filter_has_var', // this function is meant to return a boolean
'array_multisort', // this function is too buggy, see PR #113 on GitHub
'imagegrabwindow',
];
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@
'imagerotate' => ['resource|false', 'src_im'=>'resource', 'angle'=>'float', 'bgdcolor'=>'int', 'ignoretransparent='=>'bool'], //ignoretransparent is a bool instead of a int
'pg_pconnect' => ['resource|false', 'connection_string'=>'string', 'flags' => 'int'], //flags is an int instead of a string
'get_headers' => ['array|false', 'url'=>'string', 'format='=>'bool', 'context='=>'resource'], // format is a bool instead of int
'imagegrabwindow' => ['GdImage|false', 'handle'=>'int', 'client_area'=>'bool'], // client_ara is a bool instead of an int
];
1 change: 1 addition & 0 deletions rector-migrate.php
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,7 @@
'imagegd2' => 'Safe\imagegd2',
'imagegif' => 'Safe\imagegif',
'imagegrabscreen' => 'Safe\imagegrabscreen',
'imagegrabwindow' => 'Safe\imagegrabwindow',
'imagejpeg' => 'Safe\imagejpeg',
'imagelayereffect' => 'Safe\imagelayereffect',
'imageline' => 'Safe\imageline',
Expand Down

0 comments on commit c1748a0

Please sign in to comment.