This commit is contained in:
tassaron 2017-08-12 23:03:56 -04:00
parent d6b6083f80
commit 3f2834529f
1 changed files with 5 additions and 11 deletions

View File

@ -32,12 +32,12 @@ class FramePainter(QtGui.QPainter):
super().setPen(penStyle)
def finalize(self):
self.end()
imBytes = self.image.bits().asstring(self.image.byteCount())
return Image.frombytes(
frame = Image.frombytes(
'RGBA', (self.image.width(), self.image.height()), imBytes
)
self.end()
return frame
class PaintColor(QtGui.QColor):
@ -78,19 +78,14 @@ def defaultSize(framefunc):
def FloodFrame(width, height, RgbaTuple):
log.debug('Creating new %s*%s %s flood frame' % (
width, height,
'blank' if RgbaTuple[3] == 0 else RgbaTuple
)
)
width, height, RgbaTuple))
return Image.new("RGBA", (width, height), RgbaTuple)
@defaultSize
def BlankFrame(width, height):
'''The base frame used by each component to start drawing.'''
newFrame = FloodFrame(width, height, (0, 0, 0, 0))
blankFrames[(width, height)] = newFrame
return newFrame
return FloodFrame(width, height, (0, 0, 0, 0))
@defaultSize
@ -106,5 +101,4 @@ def Checkerboard(width, height):
(0, 0)
)
image = image.resize((width, height))
checkerboards[(width, height)] = image
return image