From: Jacob Sparre Andersen <sparre@nbi.dk>
Subject: [GtkAda] Gdk.RGB.Draw_Gray_Image?
Date: 19 Oct 2004 15:08:22 +0200
Date: 2004-10-19T15:08:22+02:00 [thread overview]
Message-ID: <pl7jpm97p5.fsf@sparre.crs4.it> (raw)
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"
reply other threads:[~2004-10-19 13:08 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox