예제 #1
0
 def clickimagegrab(self, event):
     x = int(self.imagegrab.canvasx(event.x))
     y = int(self.imagegrab.canvasy(event.y))
     tool.undopalette()
     newcolor = self.imagegrabtkimg.get(x,y)
     self.pixelgrid.palette[self.currentcolor] = newcolor
     self.redraw(True, True, True)
예제 #2
0
 def clickimagegrab(self, event):
     x = int(self.imagegrab.canvasx(event.x))
     y = int(self.imagegrab.canvasy(event.y))
     tool.undopalette()
     newcolor = self.imagegrabtkimg.get(x,y)
     self.pixelgrid.palette[self.currentcolor] = newcolor
     self.redraw(True, True, True)
예제 #3
0
 def setpalette(self, p):
     newp = p[:] # Keep original palette unaltered
     tool.undopalette()
     self.pixelgrid.changepalette(len(p))
     self.pixelgrid.palette = newp
     self.currentcolor = 0
     self.drawpalette()
     self.redraw()
예제 #4
0
 def setpalette(self, p):
     newp = p[:] # Keep original palette unaltered
     tool.undopalette()
     self.pixelgrid.changepalette(len(p))
     self.pixelgrid.palette = newp
     self.currentcolor = 0
     self.drawpalette()
     self.redraw()
예제 #5
0
 def dclickpalettecanvas(self, event):
     i = self.getclickedpalette(event)
     if i < len(self.pixelgrid.palette):
         color=colorchooser.askcolor(
                 initialcolor=self.pixelgrid.palette[i])
         if color[0] is None:
             return
         tool.undopalette()
         newcolor = (int(color[0][0]),int(color[0][1]),int(color[0][2]))
         self.pixelgrid.palette[i] = newcolor
         self.drawpalette()
         self.redraw()
예제 #6
0
 def dclickpalettecanvas(self, event):
     i = self.getclickedpalette(event)
     if i < len(self.pixelgrid.palette):
         color=colorchooser.askcolor(
                 initialcolor=self.pixelgrid.palette[i])
         if color[0] is None:
             return
         tool.undopalette()
         newcolor = (int(color[0][0]),int(color[0][1]),int(color[0][2]))
         self.pixelgrid.palette[i] = newcolor
         self.drawpalette()
         self.redraw()
예제 #7
0
 def rotatepalette(self):
     tool.undopalette()
     self.pixelgrid.palette = palette.rotate(self.pixelgrid.palette)
     self.drawpalette()
     self.redraw()
예제 #8
0
 def constrainpalette(self, c):
     tool.undopalette()
     palette.constrain(self.pixelgrid.palette, c)
     self.drawpalette()
     self.redraw()
예제 #9
0
 def constrainpalette(self, c):
     tool.undopalette()
     palette.constrain(self.pixelgrid.palette, c)
     self.drawpalette()
     self.redraw()