Re: gif object?



On Mon, 2001-08-27 at 14:43, gulshan wrote:
> hi all
> 
> How do I create  a gif or jpeg as a GTK banner object
> in my gui.

You can use gdkpixbuf.  See attached file for an example.

Disclaimer: I am not completely sure that I am doing it the right way in
the example, but it works for me...

	/mailund

-- 
If you can read this, you're in range.
#include <gtk/gtk.h>
#include <gdk-pixbuf/gdk-pixbuf.h>

int
main (int argc, char *argv[])
{
  GtkWidget *win;
  GdkPixbuf *img;
  GdkPixmap *pixmap;
  GdkBitmap *mask;
  GtkWidget *image;

  gtk_init (&argc, &argv);

  win = gtk_window_new (GTK_WINDOW_TOPLEVEL);

  // LOAD IMAGE
  img = gdk_pixbuf_new_from_file ("./pr0n.jpg");
  gdk_pixbuf_render_pixmap_and_mask (img, &pixmap, &mask, 0);
  image = gtk_pixmap_new (pixmap, mask);

  gtk_container_add (GTK_CONTAINER (win), image);

  gtk_widget_show_all (win);

  gtk_main ();

  return 0;
}

Attachment: pgpLPXvcCAwJG.pgp
Description: PGP signature



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