Re: Gnome Canvas

On Nov 02, 1999, Matt Herbert <> wrote:
> Also, does anybody know why whenever I draw an item
> on a canvas it always comes up black, when I tell
> it draw in different colors with "fill_color_rgba"?

> #include <gnome.h>
> int main(int argc, char *argv[])
> {
>         canvas = gnome_canvas_new();
>         gnome_canvas_item_new(
>                         gnome_canvas_root(GNOME_CANVAS(canvas)),
>                         gnome_canvas_rect_get_type(),
>                         "x1", 5.0,
>                         "y1", 5.0,
>                         "x2", 100.0,
>                         "y2", 50.0,
>                         "fill_color_rgba", 0xFF0000FF,
>                         "outline_color", "blue",
>                         "width_units", 2.0,
>                         NULL);

The "regular" canvas you are creating with gnome_canvas_new() does not
support alpha channel/transparency.  I'd have to check, but I'd imagine
that it's probably ignoring the "fill_color_rgba" attribute altogether.
Try creating the canvas with gnome_canvas_new_aa().  You could also drop
the "_rgba" from the attribute and use "fill_color" instead.  The rect
wouldn't be transparent, of course, but it would at least notice the


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