If that is the case it should work.
1. first make GdkPixmap/GdkImage of the selected region.
2. use
void gdk_draw_pixmap ( GdkDrawable
*drawable,
//gdkwindow of first gtkpixmap
GdkGC *gc,
GdkDrawable *src, //gdkpixmap of copied
region.
gint xsrc,
gint ysrc,
gint xdest,
gint ydest,
gint width,
gint height );
OR
void gdk_draw_image
( GdkDrawable *drawable,
//gdkwindow of first gtkpixmap
GdkGC *gc,
GdkImage *image, //gdkpixmap of copied
region
gint xsrc,
gint ysrc,
gint xdest,
gint ydest,
gint width,
gint height );
to draw/copy selected gdkpixmap/gdkimage. where GdkDrawable
*drawable is
GdkWindow of GtkPixmap/GtkImage where you want to put copied
region.
3. But this will get erased on redraw / expose / resize. You have to handle this drawing on redraw / expose / resize of second gtkpixmap also.
--
Simon Brenner wrote :
I am making an application where I want the user to be able to select an area of a GtkPixmap/Image and then put it on an other GtkPixmap/Image. How would I do it? I have made code for selecting area, and where to put it on the other Pixmap/Image. I've tried taking the Pixmap of my GtkPixmap widget with gtk_pixmap_get(), and then use the Gdk drawing primitives to put my other pixmap on it, but nothing appears on the screen. I have pulled my hair for a couple of days now and I've read the Gtk and Gdk manuals, but they're not very comprehensive, and I couldn't find any clues.
--------------------------------------------------------------------- VIJAYKUMAR S. KALE ESG, TTIL, Telco Campus,PUNE - 411 018 email: vskale telco co in phone: (off.) +91-212-7402049 (Direct) +91-212-7402947 (Direct) (resi.) +91-212-4358085 ---------------------------------------------------------------------- ~
Attachment:
vsk.vcf
Description: Card for VijayaKumar S. Kale