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)
# -*- 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()