image pixel information retrieval in gtk ?
I have retrieved an image. Now I have to retrieve pixel information.
I tried the following code... width = gdk_pixbuf_get_width (pixbuf); height = gdk_pixbuf_get_height (pixbuf); rowstride = gdk_pixbuf_get_rowstride (pixbuf); pixels = gdk_pixbuf_get_pixels (pixbuf); for(y=0;y<height;y++) { for(x=0;x<width;x++) {p = pixels + y * rowstride + x * n_channels; } } its ok with that, but when I'm trying to print this data or use this data anyway simultaneously....using following method: printf("%d",p[0]); printf("%d",p[1]); printf("%d",p[2]); following error is recieved: subscripted value is neither array nor pointer So can anyone tell me, where's the error? |
Quote:
|
All times are GMT -5. The time now is 11:47 AM. |