Re: Newbie help: How to put a .png icon in a toolbar button ??
- From: "Alfredo P. Ricafort" <alpot mylinuxsite com>
- To: gtk-mailing-list <gtk-list gnome org>
- Subject: Re: Newbie help: How to put a .png icon in a toolbar button ??
- Date: 12 Dec 2002 17:09:08 +0800
Hi,
Let my reply to my own post.
Changing the alpha_threshold to its highest value seems to do job.
AL
On Thu, 2002-12-12 at 15:32, Alfredo P. Ricafort wrote:
> Hi,
>
> I need some advice here as I'm terribly new to GTK+ programming(Gtk+
> 1.2).
>
> I am trying to create toolbar buttons with .png icons. From what I had
> read, you need to use the Gdkpixbuf to do this, so I coded my program
> like this:
>
> pixbuf=gdk_pixbuf_new_from_file(filename);
> gdk_pixbuf_render_pixmap_and_mask(pixbuf, &icon, &mask,0);
> iconw = gtk_pixmap_new(icon,mask);
>
> gtk_toolbar_append_item(GTK_TOOLBAR(tb),NULL,
> tooltips,
> NULL,iconw,
> callback,
> callback_data);
>
> My problem with this program is that the images are coming out
> horribly. The background of the image will be blackened. If I were to
> adjust the alpha_threshold to a higher number (instead of 0), the
> background will come out fine(i.e. the same as the background color of
> the button), but the edges would not be smooth.
>
> I there a way to improve this ? I'm sure it is not caused by the .png
> because it is being used by other programs and it comes out fine.
>
> Tks.
>
> AL
>
> _______________________________________________
> gtk-list mailing list
> gtk-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtk-list
--
Alfredo P. Ricafort <alpot mylinuxsite com>
Home
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]