#NEWLINE# def on_image_ready( self , buffer ) : #NEWLINE# #INDENT# self . nine_patch_engine . load ( buffer , self . extension ) #NEWLINE# self . nine_patch_engine . enable_alpha ( ) #NEWLINE# self . engine . enable_alpha ( ) #NEWLINE# ( nine_patch_mode , nine_patch_data ) = self . nine_patch_engine . image_data_as_rgb ( ) #NEWLINE# padding = _nine_patch . get_padding ( nine_patch_mode , nine_patch_data , self . nine_patch_engine . size [ 0 ] , self . nine_patch_engine . size [ 1 ] ) #NEWLINE# self . handle_padding ( padding ) #NEWLINE# ( mode , data ) = self . engine . image_data_as_rgb ( ) #NEWLINE# if ( mode != nine_patch_mode ) : #NEWLINE# #INDENT# raise RuntimeError ( ( 'Image mode mismatch: %s != %s' % ( mode , nine_patch_mode ) ) ) #NEWLINE# #UNINDENT# imgdata = _nine_patch . apply ( mode , data , self . engine . size [ 0 ] , self . engine . size [ 1 ] , nine_patch_data , self . nine_patch_engine . size [ 0 ] , self . nine_patch_engine . size [ 1 ] ) #NEWLINE# self . engine . set_image_data ( imgdata ) #NEWLINE# self . callback ( )