def _generateSplashFromImage(self, imagePath): if os.path.isfile(imagePath): try: return imagePath and QtGui.QImage(imagePath) except StandardError: pass return None
def _GenerateMissingSplash(self, app_name): image = QtGui.QImage(self.WIDTH, self.HEIGHT, QtGui.QImage.Format_RGB32) painter = QtGui.QPainter(image) painter.fillRect(image.rect(), QtGui.QBrush(QtGui.QColor(50, 50, 50))) font = QtGui.QFont("serif", min((self.WIDTH / len(app_name))*1.4, 250), 75, True) painter.setFont(font) painter.setPen(QtGui.QColor(80, 80, 80)) painter.drawText(30, image.height() - 60, app_name) return image