Re: gdk_draw_gray_image



hi,

I imagine you can read your file in one step, and also, try to use the magic
functions in your main():

  gdk_rgb_set_verbose(TRUE);
  gdk_rgb_init();
  gtk_widget_set_default_visual(gdk_rgb_get_visual());
  gtk_widget_set_default_colormap(gdk_rgb_get_cmap());

  ...


  fd = fopen("datafile.dat", "r");
  count = fread(inbuf, sizeof(unsigned char), 43*50, fd);
  pixbuf = inbuf;
  gdk_draw_gray_image(widget->window,
                        widget->style->fg_gc[GTK_STATE_NORMAL],
                        0, 0, 43, 50,
                        GDK_RGB_DITHER_NORMAL,
                        pixbuf, 43);

best regards

Luc Weber
Geneva Observatory
Switzerland



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