Adding some more code that doesnt work yet
this is what i thought i had pushed the other night
This commit is contained in:
@@ -24,20 +24,61 @@ from xml.dom import minidom
|
|||||||
# Won't work yet...
|
# Won't work yet...
|
||||||
# ============================================================
|
# ============================================================
|
||||||
|
|
||||||
def CreateLowerThird
|
class RealTimeNotifications
|
||||||
# define the font path as local fonts dir in prj root
|
def CreateLowerThird
|
||||||
fonts_path = os.path.join(os.path.dirname(os.path.dirname(__file__)), 'fonts')
|
# define the font path as local fonts dir in prj root
|
||||||
font = ImageFont.truetype(os.path.join(fonts_path, 'sans_serif.ttf'), 24)
|
fonts_path = os.path.join(os.path.dirname(os.path.dirname(__file__)), 'fonts')
|
||||||
# font = ImageFont.truetype(<font-file>, <font-size>)
|
font = ImageFont.truetype(os.path.join(fonts_path, 'sans_serif.ttf'), 24)
|
||||||
# font-file should be present in provided path.
|
# font = ImageFont.truetype(<font-file>, <font-size>)
|
||||||
font = ImageFont.truetype("sans-serif.ttf", 16)
|
# font-file should be present in provided path.
|
||||||
img = Image.open("sample_in.jpg")
|
font = ImageFont.truetype("sans-serif.ttf", 16)
|
||||||
draw = ImageDraw.Draw(img)
|
img = Image.open("sample_in.jpg")
|
||||||
# font = ImageFont.truetype(<font-file>, <font-size>)
|
draw = ImageDraw.Draw(img)
|
||||||
font = ImageFont.truetype("sans-serif.ttf", 16)
|
# font = ImageFont.truetype(<font-file>, <font-size>)
|
||||||
# draw.text((x, y),"Sample Text",(r,g,b))
|
font = ImageFont.truetype("sans-serif.ttf", 16)
|
||||||
draw.text((0, 0),notitxt,(255,255,255),font=font)
|
# draw.text((x, y),"Sample Text",(r,g,b))
|
||||||
img.save('sample-out.jpg')
|
draw.text((0, 0),notitxt,(255,255,255),font=font)
|
||||||
|
img.save('sample-out.jpg')
|
||||||
|
|
||||||
|
def DisplayLowerThird(displaytime, position):
|
||||||
|
global myWidget
|
||||||
|
global intYOffset
|
||||||
|
global __addon__
|
||||||
|
|
||||||
|
__addon__ = xbmcaddon.Addon(id='service.lowerthird')
|
||||||
|
|
||||||
|
ActWin = xbmcgui.getCurrentWindowId()
|
||||||
|
myWidget = OverlayText(ActWin)
|
||||||
|
myWidget.show()
|
||||||
|
|
||||||
|
if position == 'top':
|
||||||
|
myWidget.imageBottom.setImage("")
|
||||||
|
myWidget.imageCenter.setImage("")
|
||||||
|
myWidget.imageTop.setImage("sample-out.jpg")
|
||||||
|
elif position == 'bottom':
|
||||||
|
myWidget.imageBottom.setImage("sample-out.jpg")
|
||||||
|
myWidget.imageCenter.setImage("")
|
||||||
|
myWidget.imageTop.setImage("")
|
||||||
|
else:
|
||||||
|
myWidget.imageBottom.setImage("")
|
||||||
|
myWidget.imageCenter.setImage("sample-out.jpg")
|
||||||
|
myWidget.imageTop.setImage("")
|
||||||
|
|
||||||
|
image = Image.open(open("sample-out.jpg", 'rb'))
|
||||||
|
width, height = image.size
|
||||||
|
myWidget.scaleimage(width, height, intYOffset)
|
||||||
|
|
||||||
|
xbmc.log('BANNERS >> STANDALONE INITIALIZING OVERLAY')
|
||||||
|
|
||||||
|
xbmc.sleep(displaytime)
|
||||||
|
|
||||||
|
try:
|
||||||
|
myWidget._close()
|
||||||
|
except Exception:
|
||||||
|
pass
|
||||||
|
|
||||||
|
myWidget = None
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user