예제 #1
0
 def _createMissingImages(self):
     cw, ch = self.getSize()
     # back
     if not self._back:
         im = createImage(cw, ch, fill="#a0a0a0", outline="#000000")
         name = ""
         self.__addBack(im, name)
         self.cs.backnames = tuple(self.cs.backnames) + (name, )
     # bottoms / letters
     bottom = None
     neg_bottom = None
     while len(self._bottom_positive) < max(7, self.cs.nbottoms):
         if bottom is None:
             bottom = createImage(cw, ch, fill=None, outline="#000000")
         self._bottom_positive.append(bottom)
     while len(self._bottom_negative) < max(7, self.cs.nbottoms):
         if neg_bottom is None:
             neg_bottom = createImage(cw, ch, fill=None, outline="#ffffff")
         self._bottom_negative.append(neg_bottom)
     while len(self._letter_positive) < 4:
         if bottom is None:
             bottom = createImage(cw, ch, fill=None, outline="#000000")
         self._letter_positive.append(bottom)
     while len(self._letter_negative) < 4:
         if neg_bottom is None:
             neg_bottom = createImage(cw, ch, fill=None, outline="#ffffff")
         self._letter_negative.append(neg_bottom)
     self._blank_bottom = createImage(cw, ch, fill=None, outline=None)
예제 #2
0
파일: images.py 프로젝트: jimsize/PySolFC
 def _createMissingImages(self):
     cw, ch = self.getSize()
     # back
     if not self._back:
         im = createImage(cw, ch, fill="#a0a0a0", outline="#000000")
         name = ""
         self.__addBack(im, name)
         self.cs.backnames = tuple(self.cs.backnames) + (name,)
     # bottoms / letters
     bottom = None
     neg_bottom = None
     while len(self._bottom_positive) < max(7, self.cs.nbottoms):
         if bottom is None:
             bottom = createImage(cw, ch, fill=None, outline="#000000")
         self._bottom_positive.append(bottom)
     while len(self._bottom_negative) < max(7, self.cs.nbottoms):
         if neg_bottom is None:
             neg_bottom = createImage(cw, ch, fill=None, outline="#ffffff")
         self._bottom_negative.append(neg_bottom)
     while len(self._letter_positive) < 4:
         if bottom is None:
             bottom = createImage(cw, ch, fill=None, outline="#000000")
         self._letter_positive.append(bottom)
     while len(self._letter_negative) < 4:
         if neg_bottom is None:
             neg_bottom = createImage(cw, ch, fill=None, outline="#ffffff")
         self._letter_negative.append(neg_bottom)
     self._blank_bottom = createImage(cw, ch, fill=None, outline=None)
예제 #3
0
 def createMissingImage(self, width, height, fill, outline=None):
     if USE_PIL:
         return createImagePIL(width, height, fill=fill, outline=outline)
     else:
         return createImage(width, height, fill=fill, outline=outline)