#NEWLINE# def screenshot( self , * largs , **kwargs ) : #NEWLINE# #INDENT# filename = super ( WindowSDL , self ) . screenshot ( * largs , ** kwargs ) #NEWLINE# if ( filename is None ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# from kivy.graphics.opengl import glReadPixels , GL_RGB , GL_UNSIGNED_BYTE #NEWLINE# ( width , height ) = self . size #NEWLINE# data = glReadPixels ( 0 , 0 , width , height , GL_RGB , GL_UNSIGNED_BYTE ) #NEWLINE# self . _win . save_bytes_in_png ( filename , data , width , height ) #NEWLINE# Logger . debug ( ( 'Window: Screenshot saved at <%s>' % filename ) ) #NEWLINE# return filename