gdk

Saving an image (jpg) on a remote server without local hard disk

 ̄綄美尐妖づ 提交于 2019-12-24 15:13:55
问题 I have a linux app programmed in C which uses gdk for image stuff. The images are sent to a remote server through FTP (with libcurl). Currently I'm saving the images first to a local hard disk with gdk_pixbuf_save, but this seems kinda useless step. How difficult would it be to save the images directly on the remote server? I would also need to use the quality setting of jpg. 回答1: There is a gdk_pixbuf_save_to_buffer that can store data to a gchar buffer. I wasn't able to quickly find the

GTK/GDK Algorithm to take full screenshots of all monitors

ε祈祈猫儿з 提交于 2019-12-23 22:30:15
问题 I'm fairly new to the whole GTK game and want to create an algorithm to take screen shot of all monitors. I was thinking something along these lines: gdk_display_manager_list_displays each display can have multiple screens (screens means monitors?) so use gdk_display_get_n_screens to get monitors per display from 1 get root gtk window of all screens from 2 create new Pixbuf for each root gtk window for each screen from 3 with gdk_pixbuf_new fill each pixbuf from 4 with gdk_pixbuf_get_from

Problems importing GDK

南楼画角 提交于 2019-12-22 18:28:38
问题 I am trying to import GDK to my program however I continue to get an error No module named GDK Do you know how I can fix this? Since it was working before I already tried import gtk.GDK and import GDK . I have installed PyGTK and PyGDK is part of of it pyGTK. 回答1: Try: import gtk.gdk (note: small letters) 来源: https://stackoverflow.com/questions/5923746/problems-importing-gdk

Sending an image to ftp server from gchar buffer (libcurl)

我与影子孤独终老i 提交于 2019-12-20 03:23:31
问题 I'm developing a linux app programmed in C which processes gdk pixbuf images and then should send them to a remote server via ftp (libcurl). The images are saved into a gchar buffer with gdk_pixbuf_save_to_buffer. The problem is I don't know how to use the data in this buffer in conjunction with libcurl read callback function to send the image properly to the remote server. All my attempts so far have produced random bytes into the resulting file. There is an example of the libcurl read

How to enable scrolling on a simpleadapter on Google Glass's firmware X16

谁说胖子不能爱 提交于 2019-12-18 17:24:05
问题 After updating my Google Glass up to XE16 my listview, which I have built by using a simpleadapter, is not able to scroll anymore. Is there a way to manually enable scrolling nonetheless with the GDK or fix this issue? 回答1: My listview stopped scrolling as well with the X16 update. You can build scrolling back in by doing the following: In your activity's onCreate method, be sure to: set the list's choice mode set the list's clickable property to true. set the list's onItemClick listener

How to set bg image of a window in a GTK3 application

女生的网名这么多〃 提交于 2019-12-13 07:29:50
问题 I found this way: GdkPixmap *backPixMap = gdk_pixmap_create_from_xpm ( window , NULL , NULL , fileName ); gdk_window_set_back_pixmap( GTK_WIDGET( window )->window , backPixMap , FALSE ); but it seems that GdkPixmap is obsolete now... So, with GTK3, how can I set the background image of a GtkWindow? 回答1: You just need to use an Overlay. Following is an example. class Window(Gtk.Window): def __init__(self): Gtk.Window.__init__(self) self.overlay = Gtk.Overlay() self.add(self.overlay) self.bg =

Gtk+ Error when Copy / Paste performed outside of application

别说谁变了你拦得住时间么 提交于 2019-12-12 03:57:33
问题 I'm fairly new to Gtk. I'm working on a GUI application. Everything works great until I press Ctrl + C, Ctrl + V to copy/paste (in an outside application like excel). I am using Windows 8 64bit with a Mingw 32bit compiler. Any help on this issue would be appreciated. 回答1: I managed to hit the same assertion error by inducing infinite recursion (my trick was to call paste_clipboard() inside a paste_clipboard signal handler - fun fun!). Possibly you had something that responded to a clipboard

How to repair “error: gdk-pixbuf/gdk-pixdata.h: No such file or directory?”

三世轮回 提交于 2019-12-12 01:37:48
问题 I need to rotate a Pixbuf. The vala code contains using Gst, GLib, Posix, Sqlite, Gdk; public class RotateSaveImage { public void RotateSaveImage(string input, string output) { var img = new Pixbuf.from_file(input); var rotate_image = img.rotate_simple(PixbufRotation.CLOCKWISE); rotate_image.save(output, "jpeg"); } } The makefile contains test_VALAFLAGS = --vapidir=@VAPIDIR@ --pkg gstreamer-0.10 --pkg glib-2.0 --pkg gio-2.0 --pkg posix --thread --pkg gstreamer-app-0.10 --pkg sqlite3 --pkg gtk

Gdk / X11 Screen Capture

二次信任 提交于 2019-12-12 00:20:58
问题 I want to write a program that continuously captures the screen and does some modifications to the image. A complete test program can be found at: https://gist.github.com/blogsh/eb4dd4b96aca468c8bfa However, I ran into some problems. The first experiment I did was using the Gdk root window, create a Cairo context from it and then using it's target as the source for another window, where the contents are painted to: mScreenContext = Gdk::Screen::get_default()->get_root_window()->create_cairo

Gtk# Multiple File Filter

女生的网名这么多〃 提交于 2019-12-11 08:46:47
问题 I want to display only image files in GTK# File Chooser fc.SelectMultiple = true; FileFilter filter = new FileFilter(); filter.Name = "Image files"; filter.AddPattern ("*.jpg;*.jpeg;*.png;*.tif;*.bmp;*.gif;*.tiff"); fc.Filter = filter; This does not work.The file chooser does not show any Files. Can someone suggest me a proper way to do this. 回答1: As shown in the sample from the docs, the AddPattern method is meant for adding a single pattern at a time. In contrast to the WinForms