Re: Image manipulation and Scaling

2010-02-02 Thread Dov Grobgeld
The following code does it: // your original data assumed to be in a continous structure of gray. // Preferably in a structure. float *src_buf; int img_width = 256; int img_height = 256; // You destination GdkPixbuf *dst = gdk_pixbuf_new(...); guint8 *dst_buf = gdk_pixbuf_get_data(); guint src_st

Re: Image manipulation and Scaling

2010-02-02 Thread Gorav
Thanks for reply. Can you please elaborate more on Converting More than 8bit image to 8 bit image. And, apart from GtkImageView, is there no other way of image scaling? Thanks Gorav On 02/03/2010 12:02 PM, Dov Grobgeld wrote: Even if your image has more than eight bits you can always con

Re: Image manipulation and Scaling

2010-02-02 Thread Dov Grobgeld
Even if your image has more than eight bits you can always convert it to 8-bit according to a user setting defining the grey level max and min to be used for the convertion (known as window and level in the medical image community). That's exactly how I do it in my image viewer giv. The image is he

Re: locale, gui vs command line question?

2010-02-02 Thread Freddie Unpenstein
>> Or are you saying the libraries (gtk/mpfr/stdc) I'm using may be caching >> the locale and may not heed my changes? > Since Gtk+ does not have any mechanism to rebuild the UI when a locale > category changes, either you implement such mechanism or, more often, > put up with it and accept the loc

Re: Image manipulation and Scaling

2010-02-02 Thread Lars Wirzenius
On Tue, 2010-02-02 at 17:25 +0530, Gorav wrote: > Hi > > > I need to do some image manipulation using GTK, and I want to view some > proprietary image formats. So, I can prepare RGB data. But, which widget > and API to be use to draw pixels on screen. > > > I used GtkImage using Pixbuf, but i

Re: Making a Python/GTK CheckMenuItem, when clicked, not close the menu

2010-02-02 Thread David Salisbury
On Fri, 2010-01-29 at 00:27 -0500, Freddie Unpenstein wrote: > > Using Python and PyGTK I've got a GtkMenu with various GtkCheckMenuItems > > in it. When the user clicks one of the checkboxes the menu closes. I'd > > like for the user to be able to check a series of checkboxes without the > > menu

Re: Gtk+: multi-threaded or not ?

2010-02-02 Thread David Nečas
On Tue, Feb 02, 2010 at 06:14:18PM +0530, Siddu wrote: > On Tue, Feb 2, 2010 at 5:56 PM, Pierre Wieser wrote: > > > Reading this list, I see some questions which talk about "threads": main > > thread, event thread, and so on. > > > > I was not conscious Gtk+ was multithreaded. I'm conscious of as

GdkPixbuf animation

2010-02-02 Thread Tomas Soltys
Hi all, I have noticed that there is a way to load an animation using gdk_pixbuf_animation_new_from_file. But is there a way to save already loaded/created animation to a file? For example GdkPixbuf has a method gdk_pixbuf_save Thanks in advance, Tomas Soltys _

Re: Gtk+: multi-threaded or not ?

2010-02-02 Thread Siddu
On Tue, Feb 2, 2010 at 5:56 PM, Pierre Wieser wrote: > Hi all, > > Reading this list, I see some questions which talk about "threads": main > thread, event thread, and so on. > > I was not conscious Gtk+ was multithreaded. I'm conscious of asynchronous > code with the mail loop and idle function

Gtk+: multi-threaded or not ?

2010-02-02 Thread Pierre Wieser
Hi all, Reading this list, I see some questions which talk about "threads": main thread, event thread, and so on. I was not conscious Gtk+ was multithreaded. I'm conscious of asynchronous code with the mail loop and idle function (which are rather in Glib, I believe ?), but really not of multi

Image manipulation and Scaling

2010-02-02 Thread Gorav
Hi I need to do some image manipulation using GTK, and I want to view some proprietary image formats. So, I can prepare RGB data. But, which widget and API to be use to draw pixels on screen. I used GtkImage using Pixbuf, but it supports only 8 bits per sample. Then I used GtkDrawing area,

Re: locale, gui vs command line question?

2010-02-02 Thread james morris
On 2/2/2010, "David Nečas" wrote: >On Mon, 1 Feb 2010, Freddie Unpenstein wrote: >> > On Sun, 31 Jan 2010, james morris wrote: >> >> Why is store/change/restore of locale bad? >> >> > There's nothing at all wrong with it in the context you >> > specified -- i.e. you want to ensure that floating-

Re: locale, gui vs command line question?

2010-02-02 Thread David Nečas
On Tue, Feb 02, 2010 at 09:58:27AM +, james morris wrote: > > So what's the point of having a setlocale function which can tell you > the locale in use and/or set a new locale to use if this stuff is going > to be stored in cache and read/write of locale settings is going to > break the librar

Re: locale, gui vs command line question?

2010-02-02 Thread james morris
On 1/2/2010, "Freddie Unpenstein" wrote: >> There's nothing at all wrong with it in the context you specified >> -- i.e. you want to ensure that floating-point values written to >> and read from file always use '.' as the decimal separator. I do >> that in my app, gretl (also for reasons of port

Re: locale, gui vs command line question?

2010-02-02 Thread David Nečas
On Mon, 1 Feb 2010, Freddie Unpenstein wrote: > > On Sun, 31 Jan 2010, james morris wrote: > >> Why is store/change/restore of locale bad? > > > There's nothing at all wrong with it in the context you > > specified -- i.e. you want to ensure that floating-point > > values written to and read from f