Re: drawing image from a buffer using gdk_draw_image



On Fri, 14 Sep 2001 11:56:34 -0600, Patrick Sung said:

Hi,
 
 I have been trying to draw an image (16-bit color) to a 16-bit color 
 system, using a call like this:
 
 GdkImage *img = gdk_image_new (GDK_IMAGE_FASTEST, gdk_visual_get_system 
 (), 640, 482);
 
 img->depth = 16;
 img->byte_order = GDK_MSB_FIRST;
 img->bpp = 2;
 img->bpl = 640*2;
 img->mem = buf;   /* buf is the pointer to the 16-bit colored data */
 
 gdk_draw_image (some_d_area, gc, img, 0, 0, 0, 0, 640, 482);
 
 however i got a black image.  The drawing area is created using 
 gtk_drawing_area_new().
 
 Do I have to do something extra before I call gdk_draw_image().  I tried 
 to look into gdkrgb and see how it calls gdk_draw_image for 24/32 bit 
 color image, but it is too complicate for me right now, and I don't have 
 a good understanding of gdk_visual and gdk_colormap yet.

If its all possible youmight want to look at using GTK+ RGB
buffers instead, they accomplish the same thing and are easier to
use and problem free.

http://developer.gnome.org/doc/GGAD/z132.html#SEC-GDKRGB


-- 
--
Sincerely,                  ,"-_                         \|/
-Capt. Taura M.             ,   O=__                    --X--
.__                          ,_JNMNNEO=_                 /|\
OMNOUMmnne.                  {OMMNNNEEEEOO=_
UOOOBIOOOEOMMn.               'LONMMMMNNEEEOOO=.__..,,..
UUOOEUUOOOOOOOObe              '"=OMMMMWNEEEOOOOO,"=OEEEOO=,._
OOUUUIEEIOONNOIUbe.                "7OMMMMNNNNNWWEEEEOOOOOO"   "'.
EEBNNMMMNWNWWEEIMMNe.             __  7EMMMNNNNNWWWEEEEEEEOO.     " .
NNMMMMWWWMMMWEINMMMNn            "=BBEEEEMMMMMMMMNNNWWWEEOOOOO=._     .
                  http://furry.ao.net/~learfox/






[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]