Re: window into image



I use the following subroutine to save from a pixbuf to jpeg format.


static void button_save( GtkWidget *widget,
			  gpointer   data )
{
  /* try to save the current image into a jpeg format file */

  GdkPixbuf *sdata;
  gboolean aaa;
  GError *er = NULL;
  char outfil[81];
  char app[10] = ".a.jpg";

  sdata = gdk_pixbuf_new_from_data ( &pixbuf[0],
				     GDK_COLORSPACE_RGB,
				     FALSE,8,
				     imwidth, imheight,
				     3*imwidth,NULL,NULL);

  strcpy(outfil,filename);
  app[1] = app[1] + slab;
  strncat(outfil,app,6);
  slab++;

  aaa = gdk_pixbuf_save(sdata,outfil,"jpeg",&er,"quality", "100", NULL);
  if(aaa == FALSE)
    printf("PROBLEM with jpeg save to %s\n",outfil);
  else
    {
      printf("Image saved to %s\n",outfil);
      fprintf(logfile,"Image saved to %s\n",outfil);
      fflush(logfile);
    }
}



Roei Azachi wrote:
Hi,
Is there a way in gtk of taking the application window and saving it into an image (like Print screen)
Thanks,
Roei
_______________________________________________
gtk-list mailing list
gtk-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-list


------------------------------------------------------------------------


No virus found in this incoming message.
Checked by AVG - www.avg.com Version: 8.0.237 / Virus Database: 270.11.5/1978 - Release Date: 03/01/09 07:04:00


--
Dean P McCullough
301 926 4454


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