gdk_pixbuf_new_from_data读取读取未压缩的RGB数据并返回GdkPixbuf指针
原型:
GdkPixbuf *gdk_pixbuf_new_from_data(const guchar *data,
GdkColorspace colorspace, gboolean has_alpha,
int bits_per_sample, int width, int height, int rowstride,
GdkPixbufDestroyNotify destroy_fn,
gpointer destroy_fn_data);
data 指向图像数据区。这个数据区应该应该是按照从上到下、从左到右排列的像素点数据(不包含图像文件的头),并且每个象素点按照 RGB 的顺序排列(如果不是这样,需要首先调整好这些图像数据)。
colorspace 是固定的,为 GDK_COLORSPACE_RGB。
has_alpha 图像无 alpha 通道的话,可以代入 FALSE。
bits_per_sample 是固定的,为 8。
width, height 是图像的实际大小。
rowstride步长,个人理解就是图像宽度*通道数
You must calculate and pass in a rational row stride for the pixel buffer you’ve created. The pixel buffer is really only a one-dimensional array of guchar elements, so gdk-pixbuf can’t guess from the height and width parameters what your intended row stride should be. In the case of gdk_pixbuf_