gtkD load images

Johnson Jones via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Aug 2 20:59:40 PDT 2017


How can be use gtkD to load images, I assume through gdkpixbuf? 
While I am getting errors loading images through glade's image:

(test.exe:8188): Gtk-WARNING **: Could not load image 
'a.jpg': Couldn't recognize the image file format for file 
'test\a.jpg'

(loads fine in glade)

which needs to be resolved, I'd also like to be able to use 
gdkpixbuf to load images programmatically. There seems to be no 
demos on the gtkD github page that deals with image loading.

I've tried to do something like

import gtkc.gdkpixbuf;
auto x = c_gdk_pixbuf_get_formats().data;

but I don't know how to interpret x.

Also something like

		import gtkc.gdkpixbuf;
		void* x;
		auto p = c_gdk_pixbuf_get_formats();
		for(int i = 0; i < 10; i++)
		{			
			x = p.data;
			p = p.next;
		}

which doesn't offer any help.


Aside: How can we call the gtk functions directly using gtkD? 
Seems it uses stuff like

Linker.link(gdk_pixbuf_get_formats, "gdk_pixbuf_get_formats", 
LIBRARY_GDKPIXBUF);

It does seem to alias to these function but something is off and 
I'm not sure what.




More information about the Digitalmars-d-learn mailing list