Questions tagged [gdkpixbuf]

90 questions
7
votes
2 answers

How to create a PixBuf from file with Gdk3?

Environment: Python3 Libraries: from gi.repository import Gtk, Gdk import cairo I want to create a 'pixbuf from file' but the method does not longer exist in Gdk3. pb = Gdk.pixbuf_new_from_file('sunshine.png') Gdk.cairo_set_source_pixbuf(cr, pb, 0,…
user2399377
  • 71
  • 1
  • 4
6
votes
2 answers

PyGTK set icon of window with stock image

I feel like this should be pretty simple, but I guess I am missing something. So I want to set the icon of a window with one of the stock images. I have tried: windowIcon = gtk.image_new_form_stock(gtk.STOCK_DIALOG_AUTHENTICATION,…
Kevin S
  • 2,523
  • 20
  • 29
6
votes
1 answer

gtk window stops updating, even though application appears to be running otherwise

I maintain a gtk3 (though a mixture of gtk2hs and gi-gtk) application that serves as a standalone status bar for tiling window managers called taffybar. Taffybar has a long standing bug where something happens that causes one of its windows (it can…
imalison
  • 195
  • 1
  • 8
5
votes
3 answers

Show icon or color in Gtk TreeView tree

I am having difficulty loading a file or displaying a colour in one of the columns of a Gtk TreeView (Python binding of GTK3). An example taken from QGIS shows a icon in the first row and a blue circle in the second row. The colour is taken from the…
tobias47n9e
  • 2,310
  • 3
  • 23
  • 46
5
votes
2 answers

Converting PIL GdkPixbuf

How can I convert PIL Image in pixbuf?. I tried to change many examples but no solution import array from gi.repository import GdkPixbuf def image2pixbuf(self,im): arr = array.array('B', im.tostring()) height, width = im.size return…
Plaoo
  • 51
  • 3
4
votes
3 answers

What image formats are supported by Gdk-Pixbuf (Gtk-Image?) by Default?

I know that Gdk-Pixbuf supports png and jpg, but I cannot find an exact list of all the completely (or partially) supported image formats anywhere on the internet. It is necessary for my current project, since I need to check the extension of every…
ApprenticeHacker
  • 19,279
  • 24
  • 94
  • 151
4
votes
1 answer

Get pixel value on Gdk::Pixbuf, Set pixel value with Gdk::Cairo

I'm using a Gdk::Pixbuf to display an image with Gdk::Cairo in C++ : virtual bool on_draw(const Cairo::RefPtr& cr) { Glib::RefPtr image = Gdk::Pixbuf::create_from_file(filename); Gdk::Cairo::set_source_pixbuf(cr,…
Jav
  • 1,022
  • 1
  • 13
  • 32
3
votes
1 answer

Warning when saving a GdkPixbuf to file - why does it occur?

When I save GdkPixbuf contents into a file (which is supposed to be created, path determined via dialog window) using gdk_pixbuf_save(picturePixbuf, currentFileName, "bmp", &error, NULL); I get a warning: (app.exe:2012): Gtk-WARNING **: Unable to…
Clueless
  • 585
  • 3
  • 10
  • 19
3
votes
1 answer

Scrolling GtkDrawingArea

(C language, GTK library) On my form, I have a GtkDrawingArea widget on which I draw GdkPixbufs (loaded from files) with Cairo. What I'd like to accomplish is to be able to scroll the drawing area with scrollbars while window size remains fixed (the…
Clueless
  • 585
  • 3
  • 10
  • 19
3
votes
0 answers

GdkPixbuf : is it possible to change the data without instancing a new Pixbuf?

I need a Pixbuf with mutable content. This means that it needs to be updated quite fast in order to display frames with a reasonable speed. In the python binding there is the get_pixels method. Is it unclear to me if I can use it to update the data…
fstab
  • 4,153
  • 6
  • 30
  • 59
3
votes
2 answers

Improve OCR of image without scaling (using PIL, pixbuf)?

I'm trying to make OCR-recognition on a screenshot, after screenshot taken (of desktop's region, on which you clicked) it goes to pibxbuffer, which content goes to pytesseract. But after using pixbuffer image quality is bad: it's skew (I tried to…
3
votes
1 answer

Gtk+3 Gdk Pixbuf.new_from_data gives "Segmentation fault (core dumped)" error 139

In my application I have a GtkImage that must show the processed image from a choosed file. So, in the handlers section I have: import numpy as np from PIL import Image , ImageDraw from gi.repository import Gtk, GdkPixbuf . . . . . . def…
Rodolfo Leibner
  • 121
  • 1
  • 7
3
votes
3 answers

Converting Bitmap to GDK# PixBuff

How can I convert a System.Drawing.Bitmap to GDK# Image so that I can set to the image widget. I have tried this... System.Drawing.Bitmap b = new Bitmap (1, 1); Gdk.Image bmp = new Gdk.Image (b); UPDATE: Bitmap bmp=new Bitmap(50,50); …
techno
  • 5,373
  • 13
  • 65
  • 146
2
votes
1 answer

What is causing this C memory leak? (exited with error 137)

I'm not too sure why my C program is leaking, it has something to do with the set_image_scaled() function I'm pretty sure and it has to do with me resizing an image. Basically once I take a picture with gphoto2, I save that file to a jpg, then I…
2
votes
3 answers

GTKmm - How to put a pixbuf in a treeview

I'm learning how to use GTKmm and I'm having a really hard time figuring out how to put an image into a treeview. I used Glade to create a treestore with 3 columns, one of which is a GdkPixbuf called store_pixbuf. I also created a treeview in…
bmw357
  • 21
  • 1
  • 2
1
2 3 4 5 6