Re: [gtk-list] Converting a pixel value to component RGB values



On Fri, Aug 20, 1999 at 10:56:10PM -0700, Arthur Jerijian wrote:

> I am writing a function which will copy a GdkImage to an image of another
> format. As such, I need to derive the red, green, and blue component values
> from the pixel value returned by gdk_image_get_pixel. Is this just a matter of
> shifting bits? How would I do it if the GdkImage is a PseudoColor image?

You need to use the information in the GdkVisual for the window. I'm
almost certain you have to case out your code for PseudoColor
vs. TrueColor.

m.

-- 
"How wonderful! How mysterious                                   Programmer
 I carry wood! I draw water!"                   Loki Entertainment Software
 - Anonymous Tao poet



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