Quantcast
Channel: [EN] OpenPLi Third-Party Development
Viewing all articles
Browse latest Browse all 1691

is there a way to upload PNG images via startDecode, but including a transparent color parameter ("#?rrggbb") ?

$
0
0

Hello everyone.

 

Is there a way to upload PNG images via .startDecode method, but including a transparent color parameter ("#XXrrggbb") ? I can not do that. If I upload a PNG image directly in the XML skin variable, over pixmap="path", everything is OK and the transparency in the PNG image works. However, if I upload an image through the familiar enigma2 algorithm (rendering function while running the program), then transparent pixels are ignored. I also tried to change backgroundColor (in parameter settings via .setPara) in my function, but it was unsuccessful.

 

Thanks.

 

 

The referenced image rendering algorithm (from my Screen class):

def imgRender(self, path):
    self.imgfile = path
    if exists(self.imgfile):
        self.sc = AVSwitch().getFramebufferScale()
        self.img = ePicLoad()
        if self.img:
            self.img.setPara((  sizemaxH, sizemaxV, self.sc[0], self.sc[1], False, 1, '#FF000000'  )) # max-X, max-Y, scale-X, scale-Y, aspect_ratio=1.000000, cache=0, resize=1, bg=#FF000000
            if self.img.startDecode(self.imgfile, 0, 0, False) == 0:
                ptr = self.img.getData()
                if ptr is not None:
                    self["layer_pic"].instance.setPixmap(ptr)   # original entry:    .instance.setPixmap(ptr.__deref__())
                    self["layer_pic"].show()
            del self.img

Viewing all articles
Browse latest Browse all 1691

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>