Gtkプログラミング on Windows!!! (478レス)
Gtkプログラミング on Windows!!! http://mevius.5ch.net/test/read.cgi/tech/1147024203/
上
下
前次
1-
新
通常表示
512バイト分割
レス栞
抽出解除
レス栞
リロード規制
です。10分ほどで解除するので、
他のブラウザ
へ避難してください。
221: デフォルトの名無しさん [sage] 2009/05/14(木) 17:29:32 すみません、さっぱり分からないので教えてもらえないでしょうか・・・。 gtk_pixbufの関数(gdk_pixbuf_new_from_file)を使いたいのですが、やっぱりgdk_initは呼んでないと駄目ですよね? gdk_initって、DISPLAY環境変数がないと動かないようなのですけど、X Windowを立ち上げない状態ではやっぱり無理ですかね・・・。 http://jp.rubyist.net/magazine/?0019-cairo の真ん中あたりには、Xサーバーがなくても動くみたいなことが書いてあります。 この記述はあってるんですか? どうぞよろしくお願いいたします。 http://mevius.5ch.net/test/read.cgi/tech/1147024203/221
222: デフォルトの名無しさん [] 2009/05/14(木) 20:55:58 >221 CentOSだけど、DISPLAYなくても動くみたい --- ..... g_type_init(); pGError = NULL; pGdkPixbuf = NULL; pGdkPixbuf = gdk_pixbuf_new_from_file(pFile, &pGError); if (NULL == pGdkPixbuf) { fprintf(stderr, "%s:%d:%s\n", pFile, pGError->code, pGError->message); g_error_free(pGError); } else { printf("Open success %s\n", pFile); } ..... --- $ g++ -g 'gdk_pixbuf_new_from_file.c' `pkg-config gtk+-2.0 --libs --cflags` $ export DISPLAY= $ ./a.out tmp.jpg gdk_pixbuf_new_from_file(tmp.jpg) Open success tmp.jpg $ ./a.out tmp.txt gdk_pixbuf_new_from_file(tmp.txt) tmp.txt:3:Couldn't recognize the image file format for file 'tmp.txt' http://mevius.5ch.net/test/read.cgi/tech/1147024203/222
メモ帳
(0/65535文字)
上
下
前次
1-
新
書
関
写
板
覧
索
設
栞
歴
スレ情報
赤レス抽出
画像レス抽出
歴の未読スレ
Google検索
Wikipedia
ぬこの手
ぬこTOP
0.020s