weilsi 发表于 2012-4-6 11:51:59

gdk_draw_pixbuf出错了,怎么办?

pixbuf=gdk_pixbuf_new_from_file("./meigui.png",NULL);
      bitmap=(GdkBitmap*)gdk_pixmap_new(NULL,width,height,1);
    gc=gdk_gc_new(bitmap);
   gdk_draw_pixbuf(bitmap,gc,pixbuf,0,0,0,0,200,200,GDK_RGB_DITHER_NORMAL,0,0);
gtk_widget_shape_combine_mask(widget,bitmap,0,0);
       gtk_widget_show(widget);

大至程序就上面,编译能过,运行没反应,提示

The gdk_draw_*_image require the drawable argument to have a specified colormap.All windows have a colormap,however, pixmaps only have colormap by default if they were created with a non-NULL window argument. Otherwise a colormap must be set on them with gdk_drawable_set_colormap
页: [1]
查看完整版本: gdk_draw_pixbuf出错了,怎么办?