GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Sat Oct 10, 2015 7:45 pm

All times are UTC

Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Drawing GtkImage in GtkDrawingArea
PostPosted: Sun May 11, 2008 2:52 pm 

Joined: Sun May 11, 2008 2:47 pm
Posts: 1

I try to draw part of image in drawing area, but all I get is access violation:

static gboolean
expose_event( GtkWidget *widget, GdkEventExpose *event )

          event->area.x, event->area.y,
          event->area.x, event->area.y,
          event->area.width, event->area.height);

   return FALSE;

First function, where I copy portion of hand-made pixmap works fine, but img1 loaded with gtk_image_new_from_file() fails. Image loaded correcrtly, I can show it, if I use gtk_container_add().

Image is simply 128x128 bmp file.

Can anyone help me?

PS: Yes, I saw demos like images.c, but they use gtk_container_add() instead of gdk_draw_image().

 Post subject:
PostPosted: Mon May 12, 2008 3:55 pm 
Never Seen the Sunlight

Joined: Wed Sep 21, 2005 3:07 am
Posts: 384
Location: Fairfax, Virginia
You can draw a GdkImage onto a GtkDrawingArea. Why not just use that or GdkPixbuf?

Andrew Krause

Foundations of GTK+ Development: Buy now for only $31.49!

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC

Who is online

Users browsing this forum: No registered users and 3 guests

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group