gdk_draw_gray_image problem



Hi,

I ahve problem with "gdk_draw_gray_image". The code to display a
greyvalue image is shown below. If I take gdk_draw_gray_image" out of
the loop or reduce the number of loops below 3, either a solid grey
image window display is shown (0 loops ) or only the lower half of the
image (2 loops) ?

Anyone any information about what is going wrong ( the test code is
somewhat modified for clarity)?

Best regards,

Peter


void xyz_rgb_display (GtkWidget *drawing_area, image *im )
{
  
  int *p = NULL;
  guchar buf[WIDTH * HEIGHT * 3];
  gint i = 0, j = 0;
  gboolean dither = 1;

  p = image_data( im );
  
  for (j = 0; j < WIDTH * HEIGHT; j++)
     buf[j] = *p++;;
 
  for( i = 0; i < 3; i++ ){
     gdk_draw_gray_image (drawing_area->window,
			  drawing_area->style->white_gc,
			  0, 0, WIDTH, HEIGHT,
			  dither ? GDK_RGB_DITHER_MAX :
			  GDK_RGB_DITHER_NONE,
			  buf, WIDTH);
   }
}



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