forked from openlp/openlp
More Image Layer changes
This commit is contained in:
parent
9beb6c7db5
commit
04c68a075e
@ -64,8 +64,6 @@ class RenderManager(object):
|
||||
self.theme_level = u''
|
||||
self.override_background = None
|
||||
self.themedata = None
|
||||
self.save_bg_frame = None
|
||||
self.override_background_changed = False
|
||||
|
||||
def update_display(self, screen_number):
|
||||
"""
|
||||
@ -134,22 +132,6 @@ class RenderManager(object):
|
||||
self.calculate_default(self.screens.current[u'size'])
|
||||
self.renderer.set_theme(self.themedata)
|
||||
self.build_text_rectangle(self.themedata)
|
||||
#Replace the background image from renderer with one from image
|
||||
if self.override_background:
|
||||
if self.save_bg_frame is None:
|
||||
self.save_bg_frame = self.renderer.bg_frame
|
||||
if self.override_background_changed:
|
||||
self.renderer.bg_frame = resize_image(
|
||||
self.override_background, self.width, self.height)
|
||||
self.override_background_changed = False
|
||||
else:
|
||||
if self.override_background_changed:
|
||||
self.renderer.bg_frame = resize_image(
|
||||
self.override_background, self.width, self.height)
|
||||
self.override_background_changed = False
|
||||
if self.save_bg_frame:
|
||||
self.renderer.bg_frame = self.save_bg_frame
|
||||
self.save_bg_frame = None
|
||||
|
||||
def build_text_rectangle(self, theme):
|
||||
"""
|
||||
|
@ -30,7 +30,7 @@ import time
|
||||
from PyQt4 import QtCore, QtGui
|
||||
from PyQt4.phonon import Phonon
|
||||
|
||||
from openlp.core.lib import Receiver
|
||||
from openlp.core.lib import Receiver, resize_image
|
||||
|
||||
class DisplayWidget(QtGui.QWidget):
|
||||
"""
|
||||
@ -162,7 +162,7 @@ class MainDisplay(DisplayWidget):
|
||||
(self.screen[u'size'].width() - splash_image.width()) / 2,
|
||||
(self.screen[u'size'].height() - splash_image.height()) / 2,
|
||||
splash_image)
|
||||
self.frameView(self.InitialFrame)
|
||||
self.display_image.setPixmap(QtGui.QPixmap.fromImage(self.InitialFrame))
|
||||
#Build a Black screen
|
||||
painter = QtGui.QPainter()
|
||||
self.blankFrame = QtGui.QImage(
|
||||
@ -171,10 +171,11 @@ class MainDisplay(DisplayWidget):
|
||||
QtGui.QImage.Format_ARGB32_Premultiplied)
|
||||
painter.begin(self.blankFrame)
|
||||
painter.fillRect(self.blankFrame.rect(), QtCore.Qt.red)
|
||||
#buid a blank transparent image
|
||||
#build a blank transparent image
|
||||
self.transparent = QtGui.QPixmap(self.screen[u'size'].width(),
|
||||
self.screen[u'size'].height())
|
||||
self.transparent.fill(QtCore.Qt.transparent)
|
||||
self.frameView(self.transparent)
|
||||
# To display or not to display?
|
||||
if not self.screen[u'primary']:
|
||||
self.showFullScreen()
|
||||
@ -194,6 +195,16 @@ class MainDisplay(DisplayWidget):
|
||||
if not self.primary:
|
||||
self.setVisible(True)
|
||||
|
||||
def addImageWithText(self, frame):
|
||||
frame = resize_image(frame,
|
||||
self.screen[u'size'].width(),
|
||||
self.screen[u'size'].height() )
|
||||
self.display_image.setPixmap(QtGui.QPixmap.fromImage(frame))
|
||||
# self.display_image.show()
|
||||
# if not self.isVisible():
|
||||
# self.setVisible(True)
|
||||
# self.showFullScreen()
|
||||
|
||||
def frameView(self, frame, transition=False):
|
||||
"""
|
||||
Called from a slide controller to display a frame
|
||||
@ -214,6 +225,9 @@ class MainDisplay(DisplayWidget):
|
||||
self.display_text.setPixmap(QtGui.QPixmap.fromImage(frame[u'main']))
|
||||
self.display_frame = frame[u'main']
|
||||
self.repaint()
|
||||
else:
|
||||
if isinstance(frame, QtGui.QPixmap):
|
||||
self.display_text.setPixmap(frame)
|
||||
else:
|
||||
self.display_text.setPixmap(QtGui.QPixmap.fromImage(frame))
|
||||
self.display_frame = frame
|
||||
|
@ -172,7 +172,6 @@ class ImageMediaItem(MediaManagerItem):
|
||||
filename = unicode((bitem.data(QtCore.Qt.UserRole)).toString())
|
||||
self.OverrideLabel.setText(bitem.text())
|
||||
frame = QtGui.QImage(unicode(filename))
|
||||
self.parent.render_manager.override_background = frame
|
||||
self.parent.render_manager.override_background_changed = True
|
||||
self.parent.live_controller.parent.mainDisplay.addImageWithText(frame)
|
||||
else:
|
||||
MediaManagerItem.onPreviewClick(self)
|
Loading…
Reference in New Issue
Block a user