RE: [gtk-list] loading pixmap from file slow



Try using rasterman's imlib, which has a gdk_imlib version.

Tends to load xpm's quicker than the stock one, but you also get ...
- gif, jpg, pbm, etc, etc support. This can be extended by having
external methods for
  loading other file types.

- Wonderfully fast routines for manipulating the loaded pixmap - 
stretch it, alpha blend it, invert it, gamma correct it , etc.

The only downside is that rasterman's code is not always trivial to
read, but it
is trivial to make calls to it.


> -----Original Message-----
> From:	Andrew Pimlott [SMTP:pimlott@abel.MATH.HARVARD.EDU]
> Sent:	Tuesday, 9 June 1998 18:32
> To:	gtk-list@redhat.com
> Subject:	[gtk-list] loading pixmap from file slow
> 
> I am learning GTK+ and writing my first program with it.  I am finding
> 
> that loading a pixmap from a file is intolerably slow.  For example,
> the 
> following pixmap is about 50x50:
> 
> -rw-rw-r--   1 andrew   andrew      33876 Jun  9 04:37 eye.xpm
> 
> I load it with the code:
> 
> void hello(GtkWidget *widget, gpointer data)
> {
>     GtkWidget *canvas;
>     GdkPixmap *pixmap;
>     GdkBitmap *mask;
> 
>     canvas = GTK_WIDGET(data);
>     g_print("one...\n");
>     pixmap = gdk_pixmap_create_from_xpm(window->window, &mask,
>         &window->style->bg[GTK_STATE_NORMAL], "./eye.xpm");
>     g_print("two\n");
> }
> 
> Some seconds elapse between one and two.  window is a normal toplevel
> GtkWindow (made global for this example).  I don't see any reason to
> think I'm doing something unusual that would cause this.  The image
> loads
> just fine (and quickly) in GIMP and xv.  I haven't looked at the gdk
> code
> (I'd have to download it over a slow link), but I will if I don't hear
> an
> answer. 
> 
> Let me also say that GTK+, though underdocumented in many areas, has
> performed flawlessly up to this point.  The beautiful design and
> extensive widget set make it a joy to program.  The only thing I miss
> from other toolkits I've used is Tk's structured graphics Canvas. 
> 
> Thanks in advance,
> Andrew
> 
> -- 
> To unsubscribe: mail -s unsubscribe gtk-list-request@redhat.com <
> /dev/null



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