From: Olivier Andrieu MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16277.22158.816434.308669 at akasha.ijm.jussieu.fr> Date: Tue, 21 Oct 2003 17:53:50 +0200 To: Richard Jones Cc: lablgtk at kaba.or.jp Subject: Re: Crashing bug in lablgtk2 2.2.0 when reading image from pixmap (Windows only) In-Reply-To: <20031021124824.GC5277 at redhat.com> References: <20031021123817.GA5277 at redhat.com> <20031021124207.GB5277@redhat.com> <20031021124824.GC5277@redhat.com> Richard Jones [Tuesday 21 October 2003] : > > > OK, ignore the previous version. Here is a much more minimal way to > reproduce the bug. After compiling & running it, click on the button a > few times and notice the console error messages. which GTK+ version are you using ? In the NEWS file of GTK+-2.2.4 there's : * Win32 - Fix GdkImage memory leak might fix your pb. On a side note, I don't know how GdkImage and GdkPixmap are implemented on Windows but on Unix your program is a bit weird : you have a client-side pixel buffer (pixbuf), then you send it to the server (pixmap), then you send it back to the client (image) ... For accessing the pixel values I think you should definitively use pixbufs and the get_pixels function : val get_pixels : pixbuf -> Gpointer.region A Gpointer.region is pretty much like a bigarray. You can then access bytes in this region using Gpointer.get_byte (and then reconstruct your pixels) : val get_byte : region -> pos:int -> int HTH, -- Olivier