Rotating an item in gnomecanvas.............



Hi,

    I have drwan a rectangle in the canvas. When i used
gnome_canvas_item_rotate() to rotate the rectangle, i got the
error message "undefine reference to gnome_canvas_item_rotate".
Is gnomecanvas doesnt support this command? Does i have to use
affine transforms for this?

    I want to rotate the rectangle to some degree based on some
origin points. For example, rotate the rectangle, which has the
boundary points (100,100) (200,200), to 45.0 degree based on the
point (100,100 ). How can i do it?

   My code is given below.

static void
create_canvas_items(GtkWidget* canvas)
{
  GnomeCanvasGroup* group;
  GnomeCanvasItem* item;

  group = gnome_canvas_root(GNOME_CANVAS(canvas));

  /* A translucent rectangle */
  item = gnome_canvas_item_new (group,

gnome_canvas_rect_get_type(),
                                     "x1", 100.0,
                                     "y1", 100.0,
                                     "x2", 200.0,
                                     "y2", 200.0,
                                     "fill_color_rgba",
0x3cb37180,
                                     "outline_color", "black",
                                     "width_units", 4.0,
                                     NULL);

   /*  Rotate  the rectangle */

  gnome_canvas_item_rotate(item,100.0,100.0,45.0);
}


Thanx.


___________________________________________________
Television meets Accounts; Jyoti Weds Rajaram.
Rediff Matchmaker strikes another interesting match !!
Visit http://matchmaker.rediff.com?1




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