surface_create and pnm

Gadi Dor <[email protected]>
Newsgroups gmane.comp.lib.cairo
Message-ID <CAPVeivq=Geq9iQetcCWenfvUFOpkDkpftExionj1jJa+EJTsMQ@mail.gmail.com>
Hi All,

I have some code that read .pnm file with fgets and had it into buffer, Can
I change it to read my desktop:

  if(argc>1) {
    in=fopen(argv[1],"rb");
    if(!in) {
      printf("Couldn't find file %s.\n",argv[1]);
      exit(1);
    }
fgets(buffer,1024,in);
  if(strncmp(buffer,"P6",2)) {
    printf("Not a ppm.\n");
    exit(2);

I want to use this code and had it into buffer:

cairo_surface_write_to_png(cairo_xlib_surface_create(dpy,
								    DefaultRootWindow(dpy), DefaultVisual(dpy, DefaultScreen(dpy)),
								    400, 400), /* a lie */
					  "out.png")

any idea please?

Best Regards
Gadi

-- 
cairo mailing list
[email protected]
http://lists.cairographics.org/mailman/listinfo/cairo
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.