On Tue, 05 Mar 2002 09:07:20 -0500 Paul Davis <[EMAIL PROTECTED]> wrote:
> >I want to get & then set a pixel value from a GdkPixmap, but can't seem to > >find where to start. I see that pixels can be manipulated in a GdkImage > >using gdk_image_get_pixel() & gdk_image_put_pixel(), however I need to > >manipulate an off-screen pixmap rather than a copy of the window. > > you can't manipulate a GdkPixmap this way. its a server side resource, > and doesn't exist in the memory space of the client (modulo the MIT > SHM extension for X). the only way to manipulate it are through the > existing functions calls, and they do not (AFAIK) include any > pixel-level manipulation (though if you were insistent on this > approach, you could probably paint a single pixel line over and over :) > > a GdkImage is a client side resource, and hence can be accessed on a > pixel-by-pixel basis. however, it has to be drawn en-masse to a window > in order to see it (same as a GdkPixmap, but requiring more data > transfer between the client and server. Ya, that's what we're looking to do... (Pull an image from a background pixmap (or, a subset of it), manipulate a bunch of the pixels, then put the image back onto the screen) We actually found the problem, and it appears to be solved in v2... In v1.2, the function gdk_image_get() takes in a GdkWindow. (Ack!) In v2, gdk_image_get() seems to have been fixed to only require a GdkDrawable (which is what we have...) [ This is consistent with the underlying XGetImage(), which only needs a Drawable... ] (sigh) Now all we have to do is try to upgrade to v2 (earlier than I had planned)... :-/ Hopefully it's straightforward, but the Windows version has me a little worried... Thanks all! Ian _______________________________________________ gtk-list mailing list [EMAIL PROTECTED] http://mail.gnome.org/mailman/listinfo/gtk-list
