Ejemplo n.º 1
0
def image_cb(filename):
    if filename.endswith('.png'):
        img = Fl.PNG_Image(filename).asRGBA()
    elif filename.endswith('.jpg'):
        img = Fl.JPEG_Image(filename).asRGBA()
    else:
        return None

    return img.w(), img.h(), memoryview(img)
Ejemplo n.º 2
0
# -*- coding: utf-8 -*-
import sys
sys.path.append('..')
import svgplotlib.FLTK as Fl

window = Fl.Window(320, 320)
b1 = Fl.Button(10, 10, 300, 300)
image1 = Fl.PNG_Image('sudoku-128.png')
b1.image(image1)
window.end()
window.show()
Fl.run()