From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,2b9369555d1ad32b,start X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!proxad.net!news2.telebyte.nl!news.jgaa.com!news.hacking.dk!pnx.dk!not-for-mail From: Jacob Sparre Andersen Newsgroups: comp.lang.ada Subject: [GtkAda] Gdk.RGB.Draw_Gray_Image? Date: 19 Oct 2004 15:08:22 +0200 Organization: hacking.dk - Doing fun stuff with open source Sender: sparre@sparre.crs4.it Message-ID: NNTP-Posting-Host: sparre.crs4.it Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: xyzzy.adsl.dk 1098191303 5166 156.148.70.170 (19 Oct 2004 13:08:23 GMT) X-Complaints-To: usenet@news.hacking.dk NNTP-Posting-Date: Tue, 19 Oct 2004 13:08:23 +0000 (UTC) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Xref: g2news1.google.com comp.lang.ada:5452 Date: 2004-10-19T15:08:22+02:00 List-Id: I need to load a 2D array of integers (varying subset of 0 .. 65535) into a Gtk.Image.Gtk_Image object. It looks like the right approach is to: 1) Map the original data into the type Gdk.RGB.RGB_Buffer. 2) Use Gdk.RGB.Draw_Gray_Image to transfer this to a Gdk.Pixmap.Gdk_Pixmap object. 3) Use Gtk.Image.Gtk_New or Gtk.Image.Set to transfer the Gdk.Pixmap.Gdk_Pixmap object to the Gtk.Image.Gtk_Image object. My problem is the type Gdk.RGB.RGB_Buffer. It is declared as: type RGB_Buffer is array (Natural) of Glib.Guchar; How do I avoid allocating such a large object, while still being able to pass the correct data to Gdk.RGB.Draw_Gray_Image? Is there a better option for loading a 2D array of integers into a Gtk.Image.Gtk_Image object? Thanks in advance, Jacob -- "Computer Science is to Science, as Plumbing is to Hydrodynamics"