nanogui: save image
Subject:
Re: [nanogui] save image
From:
"Greg Haerr" ####@####.####
Date:
14 Nov 2007 17:06:54 +0000
Message-Id: <052e01c826e0$a85ebd10$6401a8c0@winXP>
: If you compiled nano-X with LINK_APP_INTO_SERVER = Y you may use
: GrNewPixmap(GR_SIZE width, GR_SIZE height, void *pixels) which allocates
: some space into pixels (see srvfunc.c), then GrCopyArea to copy your
: window into the id returned by GrNewPixmap, and save directly pixels[]
: in a file. Don't forget to free(pixels) :)
: AFAIK GrNewPixmap ignores void *pixels if LINK_APP_INTO_SERVER = N.
There's no need to LINK_APP_INTO_SERVER in order
to get a local buffer with GrNewPixmap. Instead, draw to a pixmap
or the screen, then use GrReadArea rather than GrCopyArea to
return the pixels to a user buffer. This will work in all cases.
Regards,
Greg