def createFrame(watchFace, resources, state): from PIL import Image, ImageDraw # graphics = Image.new('RGBA', (360, 360)) graphics = Image.new('RGBA', (Config.getImageWidth(), Config.getImageHeight())) watchFace.draw3(graphics, resources, state) return graphics
def draw2x(self, drawer, images, angle, center): x = self._x y = self._y if angle is None: temp = images[self._imageIndex].getBitmap() drawer.paste(temp, (center.getX() + x, center.getY() + y), temp) else: bitmap = images[self._imageIndex].getBitmap() from PIL import Image # temp = Image.new('RGBA', (360, 360)) # temp.paste(bitmap, (180 - x, 180 - y), bitmap) temp = Image.new('RGBA', (Config.getImageWidth(), Config.getImageHeight())) temp.paste(bitmap, (Config.getImageWidthHalf() - x, Config.getImageHeightHalf() - y), bitmap) temp = temp.rotate(angle) drawer.paste(temp, (center.getX() + 0, center.getY() + 0), temp)