#NEWLINE# def _screenshot_win32( imageFilename = None , region = None ) : #NEWLINE# #INDENT# im = ImageGrab . grab ( ) #NEWLINE# if ( region is not None ) : #NEWLINE# #INDENT# assert ( len ( region ) == 4 ) , 'region argument must be a tuple of four ints' #NEWLINE# region = [ int ( imageFilename ) for x in region ] #NEWLINE# im = im . crop ( ( region [ 0 ] , region [ 1 ] , ( region [ 2 ] + region [ 0 ] ) , ( region [ 3 ] + region [ 1 ] ) ) ) #NEWLINE# #UNINDENT# if ( imageFilename is not None ) : #NEWLINE# #INDENT# im . save ( imageFilename ) #NEWLINE# #UNINDENT# return im