gdk_pixmap_create_from_data



Hi,

what is the right way to use gdk_pixmap_create_from_data? I have a
file with 8 bit gray image data. When I create a xpm from the data and
use this code:

  pixmap = gdk_pixmap_create_from_xpm (drawing_area->window, &mask,
				       &drawing_area->style->black,
				       "akiyosy.xpm");

it works fine. But when I try to load the data directly by this code:

  fp = fopen ("akiyosy.sby", "r");
  fread (buf, 352*288, 1, fp);
  fclose (fp);

  pixmap = gdk_pixmap_create_from_data (drawing_area->window, buf,
					352, 288, 8,
					&drawing_area->style->black,
					&drawing_area->style->white);

it fails with this error:

** ERROR **: BadValue (integer parameter out of range for operation)
  serial 258 error_code 2 request_code 53 minor_code 0

IOT trap/Abort

-- 
http://www.ping.de/sites/aibon/



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