public CurveTo ( |
||
p1 | ||
p2 | ||
p3 | ||
return | void |
using Cairo; // create a new Cairo context using (var ctx = new Context(surface)) { // set the path to a curve ctx.MoveTo(50, 50); ctx.CurveTo(50, 100, 100, 100, 100, 50); // stroke the path in red ctx.SetSourceRGB(1, 0, 0); ctx.LineWidth = 2; ctx.Stroke(); // flush the Cairo context ctx.Dispose(); }
using Cairo; // create a new Cairo context using (var ctx = new Context(surface)) { // set the path to a curve ctx.MoveTo(50, 50); ctx.CurveTo(50, 100, 100, 100, 100, 50); ctx.CurveTo(100, 0, 50, 0, 50, 50); // fill the path in blue ctx.SetSourceRGB(0, 0, 1); ctx.Fill(); // flush the Cairo context ctx.Dispose(); }In this example, we create a closed curved path that starts and ends at point (50, 50). We then fill the path in blue. The Cairo Context CurveTo method is part of the Cairo graphics library, which is included in the Mono.Cairo package library.