1
您好我已经使用libpng将灰度png图像转换为使用c的原始图像。在那个lib中函数png_init_io需要文件指针来读取png。但我传递的图像作为缓冲区是否有任何其他替代功能来读取图像缓冲区为原始图像。请帮我在缓冲区中读取一个PNG图像
int read_png(char *file_name,int *outWidth,int *outHeight,unsigned char **outRaw) /* We need to open the file */
{
......
/* Set up the input control if you are using standard C streams */
png_init_io(png_ptr, fp);
......
}
相反,我需要这个像
int read_png(unsigned char *pngbuff, int pngbuffleng, int *outWidth,int *outHeight,unsigned char **outRaw) /* We need to open the file */
{
}
你的问题不是很清楚(和缺乏大写和标点符号不起作用)。你的意思是你想从内存中读取PNG图像? “pngbuff”缓冲区包含与PNG文件相同的字节? – leonbloy 2013-03-14 13:35:44
@leonbloy是的绝对你是对的..请帮助我是否有任何其他功能 – Siva 2013-03-14 13:39:34
然后我投票关闭作为重复。请参阅此处的答案:http://blog.hammerian.net/2009/reading-png-images-from-memory/ – leonbloy 2013-03-14 13:40:46