RE: gdk_draw_gray_image



Thanks for the advice, but as an end result I need the image to appear to be
drawn as if it is scrolling onto the screen line-by-line. I don't know if
that's possible using this command. I did try reading a block as described
below, but still got no visible result. Does anyone know of a command that I
might use to get the result I desire?

Lisa

-----Original Message-----
From: WEBER Luc [mailto:Luc Weber obs unige ch]
Sent: Tuesday, February 05, 2002 2:31 AM
To: gtk-app-devel-list gnome org; Lisa Klein jhuapl edu
Subject: 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]