[<<] [<] Page 1 of 1 [>] [>>] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Subject:
save image
From: pushparaj muthu ####@####.#### Date: 14 Nov 2007 05:42:21 +0000 Message-Id: <1195018932.473a8ab491259@mail.sify.com> Hi I have created image on window by using Grpoints nano -X API. Now I wanted to save image in the file . How to save image in a particulat file. I could not find any API for this. Raj | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Subject:
Re: [nanogui] save image
From: Carlo Zinato ####@####.#### Date: 14 Nov 2007 13:08:57 +0000 Message-Id: <473AF363.70006@viscount.it> pushparaj muthu ha scritto: > Hi > > I have created image on window by using Grpoints nano -X API. > Now I wanted to save image in the file . > How to save image in a particulat file. I could not find any API for this. 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. Some better solution for this? Regards, Carlo > > > Raj > > > > ------------------------------------------------------------------------ > > No virus found in this incoming message. > Checked by AVG Free Edition. > Version: 7.5.503 / Virus Database: 269.15.31/1129 - Release Date: 13/11/2007 21.22 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
[<<] [<] Page 1 of 1 [>] [>>] |