Hubert Figuiere wrote:
On 04/17/2009 02:16 AM, S. Wittenberg wrote:I tried to access the wrapped gdkpixbuf inside the Gdk::Pixbuf, but i get this, even if i #include the right header file (just to be sure): connection.cpp: In member function ‘Glib::RefPtr<Gdk::Pixbuf> Connection::getBuffer()’: connection.cpp:336: error: invalid use of incomplete type ‘struct _GdkPixbuf’ /usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-core.h:55: error: forward declaration of ‘struct _GdkPixbuf’ My code looks like this: frame_buffer = Gdk::Pixbuf::create_from_data(....); frame_buffer->gobj()->n_channels = 4;GdkPixbuf is an opaque structure. You are not able to access its fields directly.Hub
Thanks for your answer. Let me rephrase my request:I got a framebuffer thats RGBA, but otherwise compliant to the requests of the pixbuf. The gdkpixbuf seems to be capable of utilizing RGBA, while the Gdk::Pixbuf isnt... Even if i set has_alpha to true, it wont work... in fact, if i do this, it wont work at all. So i have to strip the buffer from the alpha channel, but thats quite expensive and necessary many times per second since i display various vnc-displays. If i could access the gdkpixbuf directly, just place my buffer there and set the corresponding fields, i could save some
calculations. Is there any intelligent and reasonable solution to this?