{"id":2555,"date":"2022-09-04T04:04:54","date_gmt":"2022-09-03T20:04:54","guid":{"rendered":"https:\/\/guerilla.ddns.net\/wp\/?p=2555"},"modified":"2025-08-22T22:29:33","modified_gmt":"2025-08-22T14:29:33","slug":"get-gdkpixbuf-gdktexture-gdkpaintable-size","status":"publish","type":"post","link":"https:\/\/guerilla.ddns.net\/wp\/?p=2555","title":{"rendered":"Get GdkPixbuf \/ GdkTexture \/  GdkPaintable Size"},"content":{"rendered":"<h2>GdkPixbuf<\/h2>\n<pre><code class=\"language-c\" data-line=\"\">void ShowGdkPixbufSize()\n{\n    GdkPixbuf *pixbuf = gdk_pixbuf_new_from_file(&quot;.\/image\/2.bmp&quot;, NULL);\n    g_print(&quot;The pixbuf size is %ux%u pixels.\\n&quot;, gdk_pixbuf_get_width(pixbuf), gdk_pixbuf_get_height(pixbuf));\n    g_object_unref(pixbuf);\n}<\/code><\/pre>\n<p>&nbsp;<\/p>\n<h2>GdkTexture<\/h2>\n<pre><code class=\"language-c\" data-line=\"\">void ShowGdkTextureSize()\n{\n    GdkTexture *texture = gdk_texture_new_from_filename(&quot;.\/image\/3.png&quot;, NULL);\n    g_print(&quot;The texture size is %ux%u pixels.\\n&quot;, gdk_texture_get_width(texture), gdk_texture_get_height(texture));\n    g_object_unref(texture);\n}<\/code><\/pre>\n<p>&nbsp;<\/p>\n<h2>GdkPaintable<\/h2>\n<pre><code class=\"language-c\" data-line=\"\">void ShowPictureSize()\n{\n    GtkWidget *picture;\n    GdkPaintable *paintable;\n    picture = gtk_picture_new_for_filename(&quot;.\/sample.jpg&quot;);\n    paintable = gtk_picture_get_paintable(GTK_PICTURE(picture));\n    if (paintable)\n        g_print(&quot;The picture size is %ux%u pixels.\\n&quot;, gdk_paintable_get_intrinsic_width(paintable), gdk_paintable_get_intrinsic_height(paintable));\n}<\/code><\/pre>\n<p>&nbsp;<\/p>\n<p>&nbsp;<br \/>\n#c #gtk4 #gdk4 #gdkpixbuf2<br \/>\n#fedora36 #ubuntu22.04 #gnome42.4<\/p>\n","protected":false},"excerpt":{"rendered":"<p>GdkPixbuf void ShowGdkPixbufSize() { GdkPixbuf *pixbuf  [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[212],"tags":[27,192,94],"class_list":["post-2555","post","type-post","status-publish","format-standard","hentry","category-coding","tag-coding","tag-gtk","tag-programming"],"_links":{"self":[{"href":"https:\/\/guerilla.ddns.net\/wp\/index.php?rest_route=\/wp\/v2\/posts\/2555","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/guerilla.ddns.net\/wp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/guerilla.ddns.net\/wp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/guerilla.ddns.net\/wp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/guerilla.ddns.net\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2555"}],"version-history":[{"count":7,"href":"https:\/\/guerilla.ddns.net\/wp\/index.php?rest_route=\/wp\/v2\/posts\/2555\/revisions"}],"predecessor-version":[{"id":3381,"href":"https:\/\/guerilla.ddns.net\/wp\/index.php?rest_route=\/wp\/v2\/posts\/2555\/revisions\/3381"}],"wp:attachment":[{"href":"https:\/\/guerilla.ddns.net\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2555"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/guerilla.ddns.net\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2555"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/guerilla.ddns.net\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2555"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}