本文整理汇总了Python中openlp.core.lib.ServiceItem.bg_image_bytes方法的典型用法代码示例。如果您正苦于以下问题:Python ServiceItem.bg_image_bytes方法的具体用法?Python ServiceItem.bg_image_bytes怎么用?Python ServiceItem.bg_image_bytes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类openlp.core.lib.ServiceItem
的用法示例。
在下文中一共展示了ServiceItem.bg_image_bytes方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: setup
# 需要导入模块: from openlp.core.lib import ServiceItem [as 别名]
# 或者: from openlp.core.lib.ServiceItem import bg_image_bytes [as 别名]
def setup(self):
"""
Set up and build the output screen
"""
self.log_debug('Start MainDisplay setup (live = %s)' % self.is_live)
self.screen = self.screens.current
self.setVisible(False)
Display.setup(self)
if self.is_live:
# Build the initial frame.
background_color = QtGui.QColor()
background_color.setNamedColor(Settings().value('advanced/default color'))
if not background_color.isValid():
background_color = QtCore.Qt.white
image_file = Settings().value('advanced/default image')
splash_image = QtGui.QImage(image_file)
self.initial_fame = QtGui.QImage(
self.screen['size'].width(),
self.screen['size'].height(),
QtGui.QImage.Format_ARGB32_Premultiplied)
painter_image = QtGui.QPainter()
painter_image.begin(self.initial_fame)
painter_image.fillRect(self.initial_fame.rect(), background_color)
painter_image.drawImage(
(self.screen['size'].width() - splash_image.width()) // 2,
(self.screen['size'].height() - splash_image.height()) // 2,
splash_image)
service_item = ServiceItem()
service_item.bg_image_bytes = image_to_byte(self.initial_fame)
self.web_view.setHtml(build_html(service_item, self.screen, self.is_live, None,
plugins=self.plugin_manager.plugins))
self._hide_mouse()