reload image from a file into a pixbuffer
- From: Yianni <odysseus lost gmail com>
- To: gtk-app-devel-list gnome org
- Subject: reload image from a file into a pixbuffer
- Date: Wed, 1 Nov 2006 09:56:03 +0000
Hi,
a very simple question.... but I cannot find an answer in the api.... How do
I load a picture from a file into a pixbuffer? I tried with g_timeout_add
and using the following code (which obviously not only does not work but has
memory leak problems)....
gboolean
draw_image()
{
GdkPixbuf *arena;
GString *str = g_string_new("");
if (Counter % 2)
g_string_assign(str, "img1.jpg");
else
g_string_assign(str, "img2.jpg");
arena = gdk_pixbuf_new_from_file(str->str, NULL);
gtk_widget_set_size_request(lookup_widget(RootWindow,
"drawingareaDisplay"), gdk_pixbuf_get_width(arena),
gdk_pixbuf_get_height(arena));
Counter++;
g_string_free(str, TRUE);
return TRUE;
}
Any help please? Thanks.
--
-- Yianni
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]