comp.lang.ada
 help / color / mirror / Atom feed
* [GtkAda] Gdk.RGB.Draw_Gray_Image?
@ 2004-10-19 13:08 Jacob Sparre Andersen
  0 siblings, 0 replies; only message in thread
From: Jacob Sparre Andersen @ 2004-10-19 13:08 UTC (permalink / 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"



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-10-19 13:08 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-10-19 13:08 [GtkAda] Gdk.RGB.Draw_Gray_Image? Jacob Sparre Andersen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox