Sign up

GTK3.10

I need gdk.cairo.surfaceCreateFromPixbuf, which starts in GDK3.10.

Has anyone installed this in Ubuntu 12.04? If so can you please point me at instructions.

Also, is there a function in gtkd that will tell me what version of GTK it is running against?

Re: GTK3.10

On 11/06/2013 06:53 AM, Steve Teale wrote:

I need gdk.cairo.surfaceCreateFromPixbuf, which starts in GDK3.10.

How badly do you need it?
This might suffice:

ImageSurface surface = ImageSurface.create(CairoFormat.ARGB32, 
pixbuf.getWidth(), pixbuf.getHeight());
Context context = Context.create(surface);
context.setSourcePixbuf(pixbuf, 0, 0);
context.paint();

Has anyone installed this in Ubuntu 12.04? If so can you please point me at instructions.

If there are no packages available, you'll probably need to compile GTK+
yourself. But i wouldn't recommend that.

Also, is there a function in gtkd that will tell me what version of GTK it is running against?

In gtk.Version.Version you have the get[Major|Minor|Micro]Version functions.
And the checkVersion which returns null if the running version is
compatible with the required version, or an error message otherwise.

Re: GTK3.10

On Wed, 06 Nov 2013 20:47:11 +0100, Mike Wey wrote:

On 11/06/2013 06:53 AM, Steve Teale wrote:

I need gdk.cairo.surfaceCreateFromPixbuf, which starts in GDK3.10.

How badly do you need it?
This might suffice:

ImageSurface surface = ImageSurface.create(CairoFormat.ARGB32, 
pixbuf.getWidth(), pixbuf.getHeight());
Context context = Context.create(surface);
context.setSourcePixbuf(pixbuf, 0, 0);
context.paint();

Mike, I don't see Context.setSourcePixbuf in the documentation. I was under the impression that this was one of the changes in GTK3.

I have worked out how I can do it using ImageSurface.create, and then pushing the pixbuf data into the surface. It's maybe a bit clunky, but it works with the image files I've tried.

Re: GTK3.10

On 11/07/2013 06:50 AM, Steve Teale wrote:

On Wed, 06 Nov 2013 20:47:11 +0100, Mike Wey wrote:

On 11/06/2013 06:53 AM, Steve Teale wrote:

I need gdk.cairo.surfaceCreateFromPixbuf, which starts in GDK3.10.

How badly do you need it?
This might suffice:

ImageSurface surface = ImageSurface.create(CairoFormat.ARGB32,
pixbuf.getWidth(), pixbuf.getHeight());
Context context = Context.create(surface);
context.setSourcePixbuf(pixbuf, 0, 0);
context.paint();

Mike, I don't see Context.setSourcePixbuf in the documentation. I was under the impression that this was one of the changes in GTK3.

I have worked out how I can do it using ImageSurface.create, and then pushing the pixbuf data into the surface. It's maybe a bit clunky, but it works with the image files I've tried.

It was moved to gdk.Cairo with UFCS you can call i like you used to with
GTK 2.x.

http://api.gtkd.org/src/gdk/Cairo.html#SetSourcePixbuf