5个回答

huaxiang_2015 在吗？能再帮个忙吗？
5 年多之前 回复
huaxiang_2015 回复91program: 已下，虽然之前已经下载过了，不过仍然很感谢你O(∩_∩)O
5 年多之前 回复
91program 回复huaxiang_2015: 已发。
5 年多之前 回复
huaxiang_2015 已采纳，2622109902@qq.com 谢谢~~
5 年多之前 回复
91program 回复huaxiang_2015: 你先采纳，然后留邮箱，我下载了给你。但能否用，我不保证噢。
5 年多之前 回复
huaxiang_2015 大神你有没有免费的账号借我下载一个O(∩_∩)O~
5 年多之前 回复

``````//bg
if(1){
cairo_pattern_t *pat = cairo_pattern_create_linear(0, 0, w, w);

cairo_rectangle(cr, 0, 0, w, h);
cairo_set_source(cr, pat);
cairo_fill(cr);
cairo_pattern_destroy(pat);
}
``````

``````//grid line
if(1){
for(int i=1; i<10; ++i)
{
int x = w/10 * i;
cairo_move_to(cr, x, 0);
cairo_line_to(cr, x, h);
}

for(int i=1; i<6; ++i)
{
int y = h/6 * i;
cairo_move_to(cr, 0, y);
cairo_line_to(cr, w, y);
}

const double dash_def[] = {5, 5};
int len_dash_def  = sizeof(dash_def) / sizeof(dash_def[0]);

cairo_set_dash(cr, dash_def, len_dash_def, 0);
cairo_set_line_width(cr,1);
cairo_set_source_rgba(cr,0.0,0.5,0.0,0.5);
cairo_stroke(cr);
}
``````

``````//test scope
if(1){
cairo_new_path(cr);
cairo_move_to(cr,0,0);
for(int i=0; i<300; ++i)
{
cairo_line_to(cr, i, sin(pi/100 * i) * 100 + 200);
}

cairo_set_dash(cr, 0, 0, 0);
cairo_set_line_width(cr,1);
cairo_set_source_rgb(cr,1.0,0.0,0.0);
cairo_stroke(cr);
}
``````