PyEmbeddedImage - Huh What!

I know that there are many ways to embed your images.

What I am asking for is a “script” that does it all. Or to build a public “script” that does.

How do you do it I ask?

I use a modified version of Robin’s img2py.py and generate an “art.py” file that gets imported into my top-level gui wrappers.

Output looks like this:

Generated file, do not edit.

vim: set expandtab softtabstop=4 shiftwidth=4:

from wx.lib.embeddedimage import PyEmbeddedImage

_guiArt=dict()

def addResource(resource, data):

_guiArt[resource] = PyEmbeddedImage(data)

def getResource(resource):

return _guiArt.get(resource, None)

def delResource(resource):

if _guiArt.get(resource):
    _guiArt.pop(resource)

def getImage(resource):

embedded = getResource(resource)
return embedded and embedded.Image

def getBitmap(resource):

embedded = getResource(resource)
return embedded and embedded.Bitmap

addResource(‘Appearance.png’, # 356 bytes

"iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAQAAAC1+jfqAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAu0lEQVQoz7WRsUrDYBRGT6TEwaFgcWt0z9RCi4PgIrp1a/AhfIVC"
"p07dHZ1DEKEdC4a/axU6uHUW38Cux0lMnLrkTBfuge9yP2ic6Hewy5g7BsA7K56jz5pnam6V3LQuzNWlQ2Njhy7VeXV97ZeFiZnBYGZi4c7pn/DityMwqBrAkTs/AFoA"
"TNhT1jJfWbCuhhz74IUdFwZ7nvjoZf3II+8tPffMK0/dOLP17w/gLTf0abPlKXprvoLD+QEwW2tYMK4WlgAAAABJRU5ErkJggg==")

Then I just run a shell script that basically does this:

img2py.py (6.3 KB)

···

On Fri, Apr 28, 2017 at 6:36 AM, Metallicow metaliobovinus@gmail.com wrote:

I know that there are many ways to embed your images.

What I am asking for is a “script” that does it all. Or to build a public “script” that does.

How do you do it I ask?

You received this message because you are subscribed to the Google Groups “wxPython-dev” group.

To unsubscribe from this group and stop receiving emails from it, send an email to wxPython-dev+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.