How to save pixmaps?



    Hello. I am making a simple program which loads a 
pixmap into memory. Is it possible to modify a 
GtkPixmap? What types and functions should i use to 
modify a pixmap and save it into a file?
    This is the code i use to load the pixmap:

GtkWidget* create_pixmap (GtkWidget *widget, 
                          const gchar*filename)
{
  GdkColormap *colormap;
  GdkPixmap *gdkpixmap;
  GdkBitmap *mask;
  GtkWidget *pixmap;
  GList *elem;

  colormap = gtk_widget_get_colormap (widget);
  gdkpixmap = gdk_pixmap_colormap_create_from_xpm
   (NULL, colormap, &mask, NULL, filename);

  if (gdkpixmap == NULL)
  {
    g_warning (("Pixmap not loaded: %s"), 
               (gchar*)filename);
    return NULL;
  }

  pixmap = gtk_pixmap_new (gdkpixmap, mask);

  if (pixmap != NULL)
    nombre_fichero = g_strdup(filename);

  gdk_pixmap_unref (gdkpixmap);
  gdk_bitmap_unref (mask);
  
  return pixmap;
}



Tu correo gratis en MixMail http://www.mixmail.com
Crea o sube tu web personal en http://espacio.ya.com




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