Logo Search packages:      
Sourcecode: ygraph version File versions  Download package

void export_to_dir ( Plot plot,
gchar *  dirname 

Export a sequence of frames to a directory.

This routine uses the gdk_imlib library to export each of the frames in a data set as an image in a seperate file. The individual files are output in the PNG format, and given a file name corresponding to their iteration number (hard maximum of six digits).

plot The current displayed plot.
dirname The name of the output file.

Definition at line 85 of file export.c.

References ANIMATE_MODE, frame_draw_next(), global_current_frame, global_display_mode, message_dialog(), _Plot::pixmap, and _Plot::plot_area.

Referenced by export_dir_set().

  GtkWidget* plot_area;
  GdkImlibImage* img;
  GdkImlibSaveInfo* save_info;
  gchar err_msg[MAX_LINE_LENGTH];
  gchar filename[FILE_STR_SIZE];
  gint ierr;

  ierr = mkdir(dirname, S_IRWXU);

  plot_area = plot->plot_area;

  global_display_mode = ANIMATE_MODE;
  global_current_frame = FIRST_FRAME - 1;

  save_info = g_malloc(sizeof(GdkImlibSaveInfo));

  save_info->quality = 256;
  save_info->scaling = 1;
  save_info->xjustification = 0;
  save_info->yjustification = 0;
  save_info->page_size = PAGE_SIZE_A4;

  while (frame_draw_next(NULL))
      g_snprintf(filename, FILE_STR_SIZE, "%s/%s_%06d.png", dirname, 
                 SAVE_FILE_BASE_NAME, global_current_frame);

      img = gdk_imlib_create_image_from_drawable(plot->pixmap, NULL,
                                                 0, 0,
      ierr = gdk_imlib_save_image(img, filename, save_info);

      if (ierr != 1)
          g_snprintf(err_msg, MAX_LINE_LENGTH, "Couldn't export file:\n%s",
          message_dialog (err_msg);

Generated by  Doxygen 1.6.0   Back to index