I'm creating a Image viewer in Ubuntu using PyGTK.

However, I'm not completely aware of pygtk API.

I'm not able to figure out how can I use PyGTK to

  1. access click point coordinates on an Image
  2. read a pixel value.
有帮助吗?

解决方案

I don't think you will be able to do manipulate images in the way you want with the APIs given by PyGTK.
For accessing image data, I recommend looking at the Python Imaging Library (PIL).
If you're a beginner with GTK, don't miss the tutorial of the Gnome Developer Center. There is even an example for an image viewer.
Furthermore, please keep in mind that recent applications for Ubuntu are written in GTK 3. Many many examples you find on the internet are still for PyGTK 2.x and you're not encouraged to use code from them (in case you're getting them to work).

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top