https://t.me/AnonymousX5
Server : Apache
System : Linux cvar2.toservers.com 3.10.0-962.3.2.lve1.5.73.el7.x86_64 #1 SMP Wed Aug 24 21:31:23 UTC 2022 x86_64
User : njnconst ( 1116)
PHP Version : 8.4.18
Disable Function : NONE
Directory :  /opt/alt/python27/share/doc/alt-python27-pycairo-1.8.6/examples/gtk/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //opt/alt/python27/share/doc/alt-python27-pycairo-1.8.6/examples/gtk/png_view.py
#!/usr/bin/env python
"""Display a png file
"""

import sys

import cairo
import gtk


def expose_event(widget, event, surface):
    ctx = widget.window.cairo_create()
    ctx.set_source_surface(surface, 0,0)
    ctx.paint()


if len(sys.argv) != 2:
    raise SystemExit('usage: png_view.py png_file')

filename = sys.argv[1]

surface = cairo.ImageSurface.create_from_png(filename)
Width  = surface.get_width()
Height = surface.get_height()

win = gtk.Window()
win.connect('destroy', gtk.main_quit)

drawingarea = gtk.DrawingArea()
win.add(drawingarea)
drawingarea.connect('expose_event', expose_event, surface)
drawingarea.set_size_request(Width,Height)

win.show_all()
gtk.main()

https://t.me/AnonymousX5 - 2025