#NEWLINE# def DrawFrame( currentImage , width , height , originX , originY , vertices , lines , currentVertex , currentLine , skipVertex ) : #NEWLINE# #INDENT# if ( currentImage == None ) : #NEWLINE# #INDENT# im = Image . new ( 'RGBA' , ( width , height ) , ( 150 , 150 , 150 , 0 ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# im = Image . open ( currentImage ) #NEWLINE# #UNINDENT# draw = ImageDraw . Draw ( im ) #NEWLINE# radius = 3 #NEWLINE# for c in range ( len ( vertices ) ) : #NEWLINE# #INDENT# v = vertices [ c ] #NEWLINE# color = 'black' #NEWLINE# if ( c == currentVertex ) : #NEWLINE# #INDENT# color = 'red' #NEWLINE# #UNINDENT# if ( skipVertex != c ) : #NEWLINE# #INDENT# draw . ellipse ( ( ( ( v [ 'x' ] - radius ) + originX ) , ( ( v [ 'y' ] - radius ) + originY ) , ( ( v [ 'x' ] + radius ) + originX ) , ( ( v [ 'y' ] + radius ) + originY ) ) , fill = color ) #NEWLINE# #UNINDENT# #UNINDENT# for c in range ( len ( lines ) ) : #NEWLINE# #INDENT# l = lines [ c ] #NEWLINE# color = l [ 'color' ] #NEWLINE# width = 1 #NEWLINE# if ( c == currentLine ) : #NEWLINE# #INDENT# width = 2 #NEWLINE# #UNINDENT# draw . line ( ( ( vertices [ lines [ c ] [ 'from' ] ] [ 'x' ] + originX ) , ( vertices [ lines [ c ] [ 'from' ] ] [ 'y' ] + originY ) , ( vertices [ lines [ c ] [ 'to' ] ] [ 'x' ] + originX ) , ( vertices [ lines [ c ] [ 'to' ] ] [ 'y' ] + originY ) ) , fill = color , width = width ) #NEWLINE# #UNINDENT# return im