def __getImageData(self, imageData, fmt="gif"):
if fmt=="png":
self.__importPngimagetk()
if PngImageTk is False:
raise Exception(
"TKINTERPNG library not found, PNG files not supported: " + imagePath)
if sys.version_info >= (2, 7):
self.warn(
"Image processing for .PNGs is slow. .GIF is the recommended format")
# png = PngImageTk(imagePath)
# png.convert()
# photo = png.image
else:
raise Exception("PNG images only supported in python 3: " + imagePath)
else:
imgObj = PhotoImage(data=imageData)
imgObj.path = None
imgObj.modTime = datetime.datetime.now()
imgObj.isAnimated = False
imgObj.animating = False
return imgObj
# internal function to check/build image object
评论列表
文章目录