Code: Select all
#IF DEFINED(__FB_WIN32__)
#LIBPATH "C:\opt\GTK-2.22.1\lib" ' your paths here
#LIBPATH "C:\opt\goocanvas\lib"
#ENDIF
#INCLUDE "gtk/goocanvas-2.0.0.bi"
'#INCLUDE "gtk/GTK-2.22.0_TJF.bi"
#DEFINE NULL 0
gtk_init (@__FB_ARGC__, @__FB_ARGV__)
VAR win = gtk_window_new (GTK_WINDOW_TOPLEVEL)
gtk_window_set_default_size (GTK_WINDOW (win), 640, 600)
gtk_widget_show (win)
g_signal_connect (win, "delete_event", G_CALLBACK(@gtk_main_quit), NULL)
VAR scrolled_win = gtk_scrolled_window_new (NULL, NULL)
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_win), GTK_SHADOW_IN)
gtk_widget_show (scrolled_win)
gtk_container_add (GTK_CONTAINER (win), scrolled_win)
VAR canvas = goo_canvas_new ()
gtk_widget_set_size_request (canvas, 600, 550)
goo_canvas_set_bounds (GOO_CANVAS (canvas), 0, 0, 1000, 1000)
gtk_widget_show (canvas)
gtk_container_add (GTK_CONTAINER (scrolled_win), canvas)
VAR root = goo_canvas_get_root_item (GOO_CANVAS (canvas))
VAR path_item1 = goo_canvas_path_new (root, "M20,100 C20,50 100,50 100,100", "stroke-color", "blue", NULL)
VAR path_item2 = goo_canvas_path_new (root, "M 200 500 L 40 40", "stroke-color", "red", NULL)
VAR path_item3 = goo_canvas_path_new (root, "M200,500 h-150 a150,150 0 1,0 150,-150 z", "fill-color", "green", "stroke-color", "blue", "line-width", 1.0, NULL)
VAR path_item4 = goo_canvas_path_new (root, "M100,200 C100,100 250,100 250,200 S400,300 400,200", "stroke-color", "green", "line-width", 5.0, NULL)
gtk_main ()
END 0
/'
M (absolute)
m (relative)
Parameters: (x y)+
moves to the given (x, y) coordinates to start a new subpath
=================================================================================
Z or z none closes the current subpath
=================================================================================
L (absolute)
l (relative)
Parameters: (x y)+
draws a line to the given (x, y) coordinates
=================================================================================
H (absolute)
h (relative)
Parameters: x+
draws a horizontal line to the given x coordinates
=================================================================================
V (absolute)
v (relative)
Parameters: y+
draws a vertical line to the given y coordinates
=================================================================================
C (absolute)
c (relative)
Parameters: (x1 y1 x2 y2 x y)+
draws a cubic Bézier curve to the given (x,y) coordinates, uses the given
(x1,y1) coordinates as the first control point, the (x2,y2) coordinates as the second control point
=================================================================================
S (absolute)
s (relative)
Parameters: (x2 y2 x y)+
short hand of the C/c command: the reflection relative to the current
point of the second control point of the previous command is used as the first control point.
=================================================================================
Q (absolute)
q (relative)
Parameters: (x1 y1 x y)+
draws a quadratic cubic Bézier curve to the given (x,y) coordinates,
uses the given (x1,y1) coordinates as the control point.
=================================================================================
T (absolute)
t (relative)
Parameters: (x y)+
short hand of the Q/q command: the reflection relative to the current point of the control
point of the previous command is used as the control point.
=================================================================================
A (absolute)
a (relative)
Parameters: (rx ry x-axis-rotation large-arc-flag sweep-flag x y)+
draws an elliptical arc to (x, y): the size and rotation of the ellipse are defined by two
radii (rx, ry) and the x-axis-rotation; the center (cx, cy) of the ellipse is also determined by the
large-arc-flag and sweep-flag constraint.
'/