Hello Guest, if you are reading this it means you have not registered yet. Please take a second, Click here to register, and in a few simple steps you will be able to enjoy our community and use our OpenViX support section.
Results 1 to 4 of 4

Thread: Reneder for picon?

  1. #1

    Title
    Junior Member
    Join Date
    Apr 2013
    Posts
    4
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Question Reneder for picon?

    eXcPicon.rarHi alll...
    I'm looking for any reneder to make autoscale for picons, what mean to change size for picons from (100X60) to (250X250) as widget on skin.xml ...
    Actually i'm using (eXcPicon) below code for it (BUT) this reneder make some problem
    with shutdown ... box doesn't shutdown if you selected this reneder
    change shutdown to restart...
    Code:
    from Renderer import Renderer
    from enigma import ePixmap, eEnv, ePicLoad
    from Tools.Directories import fileExists, SCOPE_SKIN_IMAGE, SCOPE_CURRENT_SKIN, resolveFilename
    
    class eXcPicon(Renderer):
    searchPaths = (eEnv.resolve('${datadir}/enigma2/%s/'),
    '/media/cf/%s/',
    '/media/usb/%s/',
    '/media/ba/%s/',
    '/media/hdd/%s/')
    
    def __init__(self):
    Renderer.__init__(self)
    self.path = 'picon'
    self.nameCache = {}
    self.pngname = ''
    
    def applySkin(self, desktop, parent):
    attribs = []
    for attrib, value in self.skinAttributes:
    if attrib == 'path':
    self.path = value
    else:
    attribs.append((attrib, value))
    
    self.skinAttributes = attribs
    return Renderer.applySkin(self, desktop, parent)
    
    GUI_WIDGET = ePixmap
    
    def changed(self, what):
    if self.instance:
    pngname = ''
    if what[0] != self.CHANGED_CLEAR:
    sname = self.source.text
    pos = sname.rfind(':')
    if pos != -1:
    sname = sname[:pos].rstrip(':').replace(':', '_')
    pngname = self.nameCache.get(sname, '')
    if pngname == '':
    pngname = self.findPicon(sname)
    if pngname != '':
    self.nameCache[sname] = pngname
    if pngname == '':
    pngname = self.nameCache.get('default', '')
    if pngname == '':
    pngname = self.findPicon('picon_default')
    if pngname == '':
    tmp = resolveFilename(SCOPE_CURRENT_SKIN, 'picon_default.png')
    if fileExists(tmp):
    pngname = tmp
    else:
    pngname = resolveFilename(SCOPE_SKIN_IMAGE, 'skin_default/picon_default.png')
    self.nameCache['default'] = pngname
    if self.pngname != pngname:
    self.picload = ePicLoad()
    self.picload.PictureData.get().append(self.piconShow)
    self.picload.setPara((self.instance.size().width(),
    self.instance.size().height(),
    1,
    1,
    False,
    1,
    '#00000000'))
    self.picload.startDecode(pngname)
    self.pngname = pngname
    
    def piconShow(self, picInfo = None):
    ptr = self.picload.getData()
    if ptr != None:
    self.instance.setPixmap(ptr.__deref__())
    return
    
    def findPicon(self, serviceName):
    for path in self.searchPaths:
    pngname = path % self.path + serviceName + '.png'
    if fileExists(pngname):
    return pngname
    
    return ''
    So please if any one have any other render send it to me if you can...

    Thank you advanced...

  2. #2

    Title
    Junior Member
    Join Date
    Apr 2013
    Posts
    4
    Thanks
    6
    Thanked 0 Times in 0 Posts
    Find (CoolPico) ... work well
    Thank you (Maggy)

  3. #3

    Title
    ViX Beta Tester
    Join Date
    Jan 2011
    Posts
    14,099
    Thanks
    3,389
    Thanked 4,102 Times in 3,198 Posts
    ??????????

  4. #4
    Rob van der Does's Avatar
    Title
    ViX Beta Tester
    Join Date
    Apr 2010
    Location
    The Netherlands & France
    Posts
    36,259
    Thanks
    1,717
    Thanked 9,461 Times in 6,675 Posts
    If you would be using ViX you would see that the image has auto-scaling of picons embedded.

    Help asked via PM will be ignored.
    The forum is there for help and all will benefit from your questions.
    NO CARD SHARING TALK WILL BE TOLERATED, LAN OR WAN, IN OPEN FORUM OR PM !

    English is not my native tongue.
    I apologise for all my grammar, spelling and idiom errors.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
This website uses cookies
We use cookies to store session information to facilitate remembering your login information, to allow you to save website preferences, to personalise content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners.