GDK & pixels

GDK & pixels

Post by Eleni Rya » Tue, 05 Mar 2002 23:00:26



Hi,

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.

Does anybody have any idea how to do this?

Thanks,
Eleni

 
 
 

GDK & pixels

Post by Norman Blac » Wed, 06 Mar 2002 05:40:25


gdk_draw_point will draw a pixel. "gdk_draw_?" for all drawing stuff.

To get a pixel you end up dealing with the whole X windows thing.
gdk_draw_point draws on a pixmap and a pixmap is a server side thing,
meaning you do not have access to the pixmap data. That is what a
"image" all about. You can "get" a pixmap into an image and then use the
image functions. The image is client side data and the data is in device
and mode dependent format. Each mode, and or video card could be
different. No something you want to deal with.

You might look into GdkRgb. It is basically a client side RGB buffer
which can be rendered directly to any GdkDrawable. GdkRgb does not have
any drawing primitives for you to use. It's all up to you.

--
Norman Black
Stony Brook Software
nospam => stonybrk


Quote:> Hi,

> 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.

> Does anybody have any idea how to do this?

> Thanks,
> Eleni


 
 
 

GDK & pixels

Post by £ukasz Li » Wed, 06 Mar 2002 09:30:29




Quote:> Hi,

> 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.

> Does anybody have any idea how to do this?

> Thanks,
> Eleni

I've got a small problem with speed
gdk_image_get_pixel() is very slow.....

is any faster way to check color of pixel ?

LISEK

 
 
 

1. How to get pixels from a Pixmap in GDK

Hi
I have a problem using GDK. I need to easily use the drawing primitive of a drawing area (line, rectangle, pixel, ...) but I need to read easilly the color of a specified pixel. GdkPixmap is perfect for the first need but can't do the second. Whereas gdkImage is perfect for the second but can't do the first. I'm a newbie in that field (I miss my Delphi on this problem) and I can't figure out a solution.
Thanks

Etienne

Man is the only animal that never learns from its mistakes.

2. Poor Desi, it isn't even the weekend and he is already drunk!

3. creating grayscale pixels in GTK/GDK

4. Mouse Problems under X

5. Display images using Gtk/Gdk/Gdk-pixbuf

6. scanners

7. How to set resolution & bit/pixel using XFree86?

8. Creative Ensoniq AudioPci64

9. Linux, DOS, & pixel resolution

10. &&&&----Looking for a unix shell------&&&&&

11. ppp && PPPoE && ADSL && net && buffer(s)

12. 没有人用中文吗?

13. &&&&&& SUGGESTION ??? &&&&&&&&