Copying a pixbuf





Hi,

I am trying to write a function to copy an area of a pixbuf (using GTK2.0). I realise that gdk_pixbuf_copy_area() already does the job, but once I have got the basic functionality working I will extend it.

However, I cannot get that basic funcionality working yet :o(
I have written it to deal with 8bpp RGB pixbufs only at the moment.

I have attached some code to this email. In the on_darea_expose() function, I can call the gdk_pixbuf_copy_area() function and then gdk_pixbuf_render_to_drawable() to simply copy across a portion of my pixbuf onto the exposed part of the drawing area.

However, if I substitute my function (ikandi_pixbuf_copy_area) for gdk_pixbuf_copy_area, things go haywire - the image gets distorted or the program segfaults.

I was hoping someone could take a brief look at my code since it is driving me mad and I cant see what I am doing wrong. The irritating thing is that it sometimes works ok (depending on the shape and size of the drawing area at any point in time).

The code has function calls for the two copy functions in it (one is commented out) so that they can be swapped between and you can see that when gdk_pixbuf_copy_area() is used it works fine.

I hope someone can help me with this!

Best regards,

Chris.

_________________________________________________________________
Express yourself with cool emoticons http://messenger.msn.co.uk

Attachment: mycanvastest.c
Description: Binary data



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]