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

void export_to_file ( Plot plot,
gchar *  filename 

Export the current frame to an image file.

This routine uses the gdk_imlib library to export the screen impage displayed in the plot_area widget of the currently opened window to a file. The type of file is determined by the specified filename extension. Format specific image parameters are given default values.

plot The current displayed plot.
filename The name of the output file.
It would be useful to be able to specify the image properties via a widget rather than set them to defaults.

Definition at line 44 of file export.c.

References message_dialog(), _Plot::pixmap, and _Plot::plot_area.

Referenced by export_file_set().

  GtkWidget* plot_area;
  GdkImlibImage* img;
  GdkImlibSaveInfo* save_info;
  gint retval;

  plot_area = plot->plot_area;

  img = gdk_imlib_create_image_from_drawable(plot->pixmap, NULL,
                                             0, 0,

  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;

  retval = gdk_imlib_save_image(img, filename, save_info);

  if (retval != 1)
    message_dialog ("Couldn't export file.");

Generated by  Doxygen 1.6.0   Back to index