Re: Releasing client-side pixmaps



On Wed, 23 Oct 2002 15:16:20 +0200
Dag Helstad <dag helstad kreatel se> wrote:

Hi, all

I'm read your mail and I was interested how to use gdk-pixbuf library,
I making an application using GTK1.2 in C (in this moment I don't know if gdk-pixbuf is to use with GTK1.2) and I don't 
know what #includes I put in my program and what I must change in Makefile (my Makefile was generated by Glade -> ./configure ...)
I using devhelp to obtain help about use of these functions but there I didn't found how to compile some application with this library.

I you can give me some tips about this I will be been thankful.

Thanks

-- 
Flavio Alberto Lopes Soares
flavio maqplas com br
Linux User n. 257636

MAQPLAS INDÚSTRIA E COMÉRCIO DE MÁQUINAS LTDA.
www.maqplas.com.br
maqplas maqplas com br


> Hi, I'm trying to minimize the memory usage of a GTK application which uses
> a GtkPixmap to show a background pixmap. 
> 
> The X server keeps a server-side copy of the pixmap, but it seems a
> client-side copy is kept in my application.
> 
> Here is the code fragment which creates a gtk_pixmap from my bitmap (which
> is stored in PNG format):
> 
> /****************************/
> GtkWidget* LoadImage(const std::string& location)
> {
>    GtkWidget* widget = NULL;
>    GdkPixbuf* image = NULL;
>    GdkPixmap* pixmap = NULL;
>    GdkBitmap* mask = NULL;
> 
>    image=gdk_pixbuf_new_from_file(location.c_str());
>    gdk_pixbuf_render_pixmap_and_mask(image, &pixmap, &mask, 100);
> 
>    widget = gtk_pixmap_new(pixmap, mask);
> 
>    gdk_pixmap_unref(pixmap);
>    gdk_bitmap_unref(mask);
>    gdk_pixbuf_unref(image);
>    
>    return widget;
> }
> /****************************/
> 
> I unref() the GdkPixbuf, GdkPixmap and GdkBitmap. Does the GtkPixmap widget
> keep a client-side copy of the pixmap? Can I free the client-side pixmap
> without destroying my GtkPixmap widget?
> 
> Regards, 
> Dag Helstad
> _______________________________________________
> gtk-list mailing list
> gtk-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtk-list





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