Re: saving picture files in a graphics editor




Hi!

On Fri, 28 May 2004 08:27:41 -0700 (PDT)
Nandan Rao <nandanraobvb yahoo co in> wrote:

Hi,
    I am developing a graphics editor on gtk. How could I save the
    pixmap (generated while drawing objects on the drawing area) in
    the form of a picture file .

you can use this code

    height = p->widget->allocation.height;
    width = p->widget->allocation.width;
    dest = gdk_pixbuf_get_from_drawable (NULL, pixmap, NULL, 0,0,0,0,
                                         width, height);
    if (dest)
    {
      ret = gdk_pixbuf_save (dest, filename, "jpeg", &error,
                             "quality", "100", NULL);
      g_object_unref (dest);
    }





-- 
Hubert Sokolowski



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