Hi, It worked. Thanks a lot. Regards, Selva
-----Eduardo Matus <[email protected]> wrote: ----- To: [email protected] From: Eduardo Matus <[email protected]> Date: 07/21/2010 04:53PM cc: donn <[email protected]>, [email protected] Subject: Re: Need example code to fill a color with opacity in ClutterRectangle with border Then you should comment the line clutter_actor_set_opacity(...) and set the opacity in the clutter_rectangle_new_with_color function, example clutter_rectangle_new_with_color(clutter_color_new(255,255,255,125)) On Wed, Jul 21, 2010 at 7:48 PM, <[email protected]> wrote: Hi, Thanks for the response. I did this. But the problem is the opacity is applied to both the rectangle fill and rectangle border. My requirement is "the opacity should only be applied to rectangle fill color. The opacity should not be applied to rectangle border color." For example, in MS Visio, the transparency can be set only to fill color and not the border color. How do I achieve this in Clutter? Regards, Selva [email protected] wrote: ----- To: donn <[email protected]> From: Eduardo Matus <[email protected]> Sent by: [email protected] Date: 07/21/2010 11:15AM cc: [email protected] Subject: Re: Need example code to fill a color with opacity in ClutterRectangle with border this is a working example... #include <stdio.h>#include <clutter/clutter.h> int main (int argc, char *argv[]) { ClutterActor *stage; ClutterRectangle *rect; const ClutterColor bg_color = { 0xe0, 0xf2, 0xfc, 0xff }; clutter_init (&argc, &argv); stage = clutter_stage_get_default (); clutter_stage_set_color (CLUTTER_STAGE (stage), &bg_color); rect = clutter_rectangle_new_with_color (clutter_color_new(0, 0, 0, 255)); clutter_rectangle_set_border_color (rect, clutter_color_new (255,255,255, 255)); clutter_rectangle_set_border_width (rect, 10); clutter_actor_set_size( CLUTTER_ACTOR(rect), 300, 300); clutter_actor_set_opacity( CLUTTER_ACTOR(rect), 125); clutter_actor_set_position(CLUTTER_ACTOR(rect), 30, 30); clutter_container_add_actor (CLUTTER_CONTAINER (stage), CLUTTER_ACTOR(rect)); clutter_actor_show_all (stage); clutter_main(); return 0;} On Wed, Jul 21, 2010 at 1:45 PM, donn <[email protected]> wrote: On 21/07/2010 19:24, [email protected] wrote: ClutterRectangle* pRect = clutter_rectangle_new_with_color (clutter_color_new (0, 0, 0, 0) ); I *think* that last 0 means alpha = 0 : i.e. it's invisible right from the start. clutter_actor_set_opacity( CLUTTER_ACTOR(pRect), 125); Not sure what 125 of invisible looks like ;) I don't know the answer in re the outline, but opacity and I are not the best of friends either. Maybe the above will help you debug. \d _______________________________________________ clutter-app-devel-list mailing list [email protected] http://lists.clutter-project.org/listinfo/clutter-app-devel-list -- Eduardo Matus Coquelet Ingeniero Civil Informático y Telecomunicaciones. Celular: 77113825 _______________________________________________ clutter-app-devel-list mailing list [email protected] http://lists.clutter-project.org/listinfo/clutter-app-devel-list -- Eduardo Matus Coquelet Ingeniero Civil Informático y Telecomunicaciones. Celular: 77113825
_______________________________________________ clutter-app-devel-list mailing list [email protected] http://lists.clutter-project.org/listinfo/clutter-app-devel-list
