[IronPython] IronPython: how to display a PNG

Luke Kenneth Casson Leighton lkcl at lkcl.net
Tue Nov 22 11:44:10 CET 2005

hi there,

the concept of ironpython?  absolutely _love_ it - and am prepared to
stick with it until i find a solution.

this should be a simple, simple task: how to display a PNG
image, and change it to another image, to make a stop-motion
animated figure on-screen, using IronPython.

the plan is to have the same program work on linux and windows
(so that means 0.6 because mono - at least apt-get install
mono - doesn't support .net 2.0 stuff yet on linux: IronPython
0.9.4 and 0.9.5 throw an error about some attributes missing)

i've spent 3 days, several hours per day, looking for example code,
dealing with monodoc (apt-get install monodoc) crashing, finding out
that you have to do this in order to be able to get to Gdk:

	import sys
	sys.LoadAssemblyFromFile ("/usr/share/dotnet/mono/gtk-sharp/gdk-sharp.dll")
	import Gdk
and finding out that that's not enough, you also have to do this (at
least, the first two lines, you do - i added the other two myself to see
if it made any difference to _another_ problem)

	<dllmap dll="libgobject-2.0-0.dll" target="libgobject-2.0.so.0"/>
	<dllmap dll="libglib-2.0-0.dll" target="libglib-2.0.so.0"/>
	<dllmap dll="libgdk-win32-2.0-0.dll" target="libgdk-x11-2.0.so.0"/>
	<dllmap dll="libgdk_pixbuf-2.0-0.dll" target="libgdk_pixbuf-2.0.so.0"/>

quite literally, and very unusually, i can't find _any_ working examples
of code that will display PNGs on-screen.

i found this:


but it has bugs in it that stop it from working - fix the typos and it
starts throwing up GDK_DRAWING assertions about depth = -1 or drawing =

it's all very weird because everyone's raging about IronPython and how
good it is: can you find _working_ example code that DoesTheJob(tm)?

...mmmm.... nope!

the ironpython list archives aren't even searchable by google!

so - could someone _please_ please point me in an appropriate
direction of some example code or a tutorial with example
code-fragments of how to friggin display PNGs on a screen.

really appreciated.


<a href="http://lkcl.net">http://lkcl.net</a>

More information about the Ironpython-users mailing list