Subject:
GrArea
From:
####@####.####
Date:
29 Nov 2000 07:14:48 -0000
Message-Id: <200011290717.PAA20998@cape.com.cn>
Hello Greg:
thanks a lot!
what is the meaning of the variable psd->ncolors ?
additional:
the code blow is working ,no errors
void save()
{
GR_PIXELVAL intable[WIDTH*HEIGHT];
GrReadArea(fl_window, 0, MENU_HEIGHT, WIDTH, HEIGHT-MENU_HEIGHT, intable);
write(handle, intable, 240*300);
for(int i=0;i<300;i++) {
for(int j=0;j<240;j++) {
;;;;;
}
}
GrArea(fl_window, fl_gc, 0, MENU_HEIGHT, WIDTH, HEIGHT, intable, MWPF_PIXELVAL);
redraw();
}
but this code blow will occured failure:
void save()
{
GR_PIXELVAL intable[WIDTH*HEIGHT];
GrReadArea(fl_window, 0, MENU_HEIGHT, WIDTH, HEIGHT-MENU_HEIGHT, intable);
write(handle, intable, 240*300);
for(int i=0;i<300;i++) {
for(int j=0;j<240;j++) {
intable[i*240+j]+=0x60;
}
}
GrArea(fl_window, fl_gc, 0, MENU_HEIGHT, WIDTH, HEIGHT, intable, MWPF_PIXELVAL);//this line occured the c<psd->ncolors failure;
redraw();
}
It seems that I cann't change the pixel color very effective via change the intable buffer, isn't it???????
if the type of intable is long then the last argument should be MWPF_TRUECOLOR332, isn't it?????
thanks!!!
I read the source code the definition of MWPF_PIXELVAL is
#define MWPF_RGB 0 /* pseudo, convert from packed 32 bit RGB*/
#define MWPF_PIXELVAL 1 /* pseudo, no convert from packed PIXELVAL*/
#define MWPF_PALETTE 2 /* pixel is packed 8 bits 1, 4 or 8 pal index*/
#define MWPF_TRUECOLOR0888 3 /* pixel is packed 32 bits 8/8/8 truecolor*/
#define MWPF_TRUECOLOR888 4 /* pixel is packed 24 bits 8/8/8 truecolor*/
#define MWPF_TRUECOLOR565 5 /* pixel is packed 16 bits 5/6/5 truecolor*/
#define MWPF_TRUECOLOR332 6 /* pixel is packed 8 bits 3/3/2 truecolor*/.
regards!!! .
wls