#NEWLINE# def update_image( self ) : #NEWLINE# #INDENT# if ( self . tkcanvas is None ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# cr = self . tkcanvas #NEWLINE# items = cr . find_all ( ) #NEWLINE# for item in items : #NEWLINE# #INDENT# cr . delete ( item ) #NEWLINE# #UNINDENT# ( wd , ht ) = self . get_window_size ( ) #NEWLINE# surface = self . get_surface ( ) #NEWLINE# if isinstance ( surface , numpy . ndarray ) : #NEWLINE# #INDENT# arr8 = surface #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# arr8 = numpy . fromstring ( surface . tostring ( ) , dtype = numpy . uint8 ) #NEWLINE# arr8 = arr8 . reshape ( ( ht , wd , 4 ) ) #NEWLINE# #UNINDENT# image = PILimage . fromarray ( arr8 ) #NEWLINE# photo = PILimageTk . PhotoImage ( image ) #NEWLINE# self . tkphoto = photo #NEWLINE# cr . create_image ( 0 , 0 , anchor = 'nw' , image = photo ) #NEWLINE# cr . config ( scrollregion = cr . bbox ( 'all' ) )