은 나를 위해 일한 다음 : 도면 영역의 유형은 Xlib를이 (안 이미지면)입니다
typedef struct{
guint16 red;
guint16 green;
guint16 blue;
guint16 alpha;
} color_struct;
color_struct get_pixel_pixbuf(double x,double y,GdkPixbuf *pixbuf,unsigned char *pixels){
color_struct color;
guchar *p;
p = pixels + ((int)y) * gdk_pixbuf_get_rowstride (pixbuf) + ((int)x) * gdk_pixbuf_get_n_channels(pixbuf);
color.red = p[0];
color.green = p[1];
color.blue = p[2];
color.alpha = p[3];
return color;
}
GtkWidget *drawingarea;
GdkPixbuf *surface_pixbuf = gdk_pixbuf_get_from_drawable(NULL,GDK_DRAWABLE(drawingarea->window),gdk_colormap_get_system(),0,0,0,0,drawingarea->allocation.width,drawingarea->allocation.height);
pixbuf_pixels = gdk_pixbuf_get_pixels (surface_pixbuf);
color_struct *pixel_color = get_pixel_pixbuf(someX,someY,surface_pixbuf,pixbuf_pixels);
때문에 복사본을 생성 할 필요가 없었다 후자의 유형.