Questions tagged [gdkpixbuf]

93 questions
10
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
  • 101
  • 1
  • 5
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,713
  • 24
  • 31
5
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
  • 21,351
  • 27
  • 103
  • 153
5
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
  • 335
  • 3
  • 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,233
  • 3
  • 28
  • 54
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
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,445
  • 1
  • 18
  • 47
4
votes
1 answer

Gdk pixbuf load image from memory

Using GTK+ 3.6 I would like to display an image from a buffer in memory, not a file on disk. I have a const char *data with the image data, and I'm trying to create a GTK image from it. So far I have tried two approaches which I thought could work.…
Matekk
  • 683
  • 2
  • 8
  • 21
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
  • 605
  • 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
  • 605
  • 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,801
  • 8
  • 34
  • 66
3
votes
0 answers

Drawing a custom GdkPixbuf using Gtk3 and cairo

I would like to draw a custom shape in a cell of a Gtk.TreeView, using Python and GTK3. I have found out that cairo shall be used for this, but could not find any way to create a suitable Pixbuf object. I can load a file from the disk easily; but…
dominecf
  • 384
  • 4
  • 13
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
  • 171
  • 1
  • 7
3
votes
1 answer

What is the correct syntax of GdkPixbuf.Pixbuf.savev() when used in Python?

I am trying to save the content of a GdkPixbuf.Pixbuf object to a file in Python 2.7. It seems that the Pixbuf.save() method that appears in the documentation is not available from Python, and only Pixbuf.savev() is available. I have searched high…
1
2 3 4 5 6 7