Wednesday, March 5, 2008

使用GDK的函式庫從檔案讀取圖片

放一下 簡單的code 作個備份

#include
#include
#include


int main(int argc, char**argv)
{
GtkWidget *window;

GtkWidget *frame;

GdkPixbuf *pixbuf;

GtkWidget *img;

gtk_init(&argc, &argv);

window=gtk_window_new(GTK_WINDOW_TOPLEVEL);

pixbuf = NULL;

pixbuf = gdk_pixbuf_new_from_file("test00.jpg",GError);

img = gtk_image_new_from_pixbuf(pixbuf);

gtk_container_add(GTK_CONTAINER(window),img);

gtk_widget_show_all(window);

gtk_main();

return 0;
}


--

1 comment:

發表一下意見,互動一下唄!

LinkWithin

Related Posts Plugin for WordPress, Blogger...

Adventure Book 2.0 Headline Animator

GoogleAd

funP Android 相關文章