#include #include int main(int argc, char *argv[]) { cairo_surface_t *surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, 3640, 3480); cairo_t *cr = cairo_create (surface); cairo_pattern_t* pattern = cairo_pattern_create_mesh(); cairo_mesh_pattern_begin_patch(pattern); assert(cairo_pattern_status(pattern) == CAIRO_STATUS_SUCCESS); cairo_mesh_pattern_move_to(pattern, 1090.0, 1736.0); cairo_mesh_pattern_curve_to(pattern, 1758.0, 1685.3333333333333,2426.0, 1634.666666666666,3094.0, 1584.0); cairo_mesh_pattern_curve_to(pattern, 3542.0, 2412.0, 2546.031707763672, 1684.0107040405273, 2350.0, 1720.0); cairo_mesh_pattern_curve_to(pattern, 2085.1669311523438, 1768.6204833984375, 1695.2612915039062, 2281.1830883026123, 1375.821533203125, 2299.57275390625); cairo_mesh_pattern_curve_to(pattern, 1056.3817749023438, 2317.9624195098877,1166.6922988891602, 1933.8935241699219, 1090.0, 1736.0); assert(cairo_pattern_status(pattern) == CAIRO_STATUS_SUCCESS); cairo_mesh_pattern_set_corner_color_rgba (pattern, 0, 1.0, 0.0, 0.0, 1.0); cairo_mesh_pattern_set_corner_color_rgba (pattern, 1, 1.0, 0.0, 0.0, 1.0); cairo_mesh_pattern_set_corner_color_rgba (pattern, 2, 1.0, 0.0, 0.0, 1.0); cairo_mesh_pattern_set_corner_color_rgba (pattern, 3, 1.0, 0.0, 0.0, 1.0); assert(cairo_pattern_status(pattern) == CAIRO_STATUS_SUCCESS); cairo_mesh_pattern_end_patch(pattern); assert(cairo_pattern_status(pattern) == CAIRO_STATUS_SUCCESS); cairo_set_source(cr, pattern); cairo_paint(cr); cairo_move_to (cr, 1090.0, 1736.0); cairo_curve_to(cr, 1758.0, 1685.3333333333333,2426.0, 1634.666666666666,3094.0, 1584.0); cairo_curve_to(cr, 3542.0, 2412.0, 2546.031707763672, 1684.0107040405273, 2350.0, 1720.0); cairo_curve_to(cr, 2085.1669311523438, 1768.6204833984375, 1695.2612915039062, 2281.1830883026123, 1375.821533203125, 2299.57275390625); cairo_curve_to(cr, 1056.3817749023438, 2317.9624195098877,1166.6922988891602, 1933.8935241699219, 1090.0, 1736.0); cairo_close_path (cr); cairo_set_line_width (cr, 10.0); cairo_set_source_rgb (cr, 0, 0, 0); cairo_stroke (cr); cairo_surface_write_to_png (surface, "bezier.png"); cairo_pattern_destroy (pattern); return 0; }