Re: [gtk-list] Easy way to reverse a gtk_pixmap?
- From: Havoc Pennington <hp redhat com>
- To: Pedro Morais <pmmm rnl ist utl pt>
- cc: gtk-list redhat com
- Subject: Re: [gtk-list] Easy way to reverse a gtk_pixmap?
- Date: Fri, 22 Oct 1999 10:03:32 -0400 (EDT)
On Fri, 22 Oct 1999, Pedro Morais wrote:
>
> Is there any easy way to (temporarily) reverse a gtk_pixmap; that is, every
> white pixel becomes black and every black pixel becomes white.
>
Not really - in general, if you want to manipulate or transform image data
then a pixmap is a poor choice (GdkPixmap is a server-side image,
GtkPixmap is a widget that displays it; the pixels are _not_ in your
process's address space!).
If you did want to do it, the procedure would be something like the
build_disabled_pixmap() routine in gtkpixmap.c, that is, you suck the
pixmap into a GdkImage (client side image data) then manipulate it.
An RGB buffer combined with GdkRGB (or one of the heavy-duty graphics
libraries like OpenGL/GtkGLArea) is the best way to approach pixel
manipulation.
However that is likely to be overkill; the simplest solution for this
trivial case is probably to have two different images and swap them out.
Havoc
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]