GtkImage and GtkPixmap programming (more info)



I'll send you the current code I have for displaying part of one pixmap on an GtkPixmap. I've looked for docs on doing something similar with GtkImage's buit haven't found any docs for it. I get no errors with this code, but simply nothing appears on the target pixmap.

I have checked the input coordinates, width and height. The mask of the target GtkPixmap is filled with 1:s (The GtkPixmap appears black). The Source GtkPixmap is also displayed on the screen, so I know that there are no funny stuff there. There are also no transparencies in the source pixmap.

The main reason that I don't use GtkImage's even though there are functions for drawing is that there is no function for putting entire images (or parts of images) on them. There are only functions for setting one pixel at a time, which I think would be really slow to use.

--
// From Simon 'Simon The Sourcer' Brenner \\
\\       May the source be with you       //
GdkPixmap *dest_pxm;
GdkBitmap *dest_bmp;
GdkPixmap *src_pxm;
GdkBitmap *src_bmp;
GdkGC *gc;
                
pxmMapWindow.GetPixmap(&dest_pxm, &dest_bmp);
pxmSelectArea.GetPixmap(&src_pxm, &src_bmp);

gc=gdk_gc_new(dest_pxm);
gdk_window_copy_area(((GtkWidget *)pxmMapWindow)->window, gc, src_x,
src_y, src_pxm, dst_x, dst_y, width, height);
gdk_gc_unref(gc);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]