Skip to main content

experiment of the day:

Vala bindings for Zint barcode generator library , with a simple Gtk UI to generate barcodes

Sylke Vicious reshared this.

How did you know I need this! ?

My meagre attemt is here:
and also, can it get a Gtk.Image somehow? I was able to a) either save it to a file or retrieve an in-memory bitmap which could not be easily squeezed into a Gtk.Image.

Going to check it out.
You can load the bitmap into a Gdk.PixBuf, then you can do whatever.

I wanted to have the bitmap field as uint8[], mostly because looks vala-y and because it's what is in Gdk.PixBuf.from_data()'s signature).
I found that it needs a length to works with Gdk.PixBuf.from_data(), so I added the get_bitmap() method to set the length.. It works but I don't know if it's the correct solution... there so much things I'm not sure about and docs are useful only up to a point...

(as a side node, the zint.h header I have on disk has a bitmap_byte_length field which would be so good to use as length value for bitmap (setting it directly in field's annotation in vapi) but looks like is not used and docs doesn't mention it.....)
Oh for Vala's sake! I spent a day on this (vala is not a language I really know) and now there are already at least two vapi files ready 😃

This website uses cookies to recognize revisiting and logged in users. You accept the usage of these cookies by continue browsing this website.