[cairo] How to take cairo_set_source_rgb effect for different color points?
xiangzhai83 at gmail.com
Sun Oct 6 00:50:59 PDT 2013
Hi cairo developers,
I wanna draw some points indicating mouse`s X and Y, and used random
number from 0 to 255 for RGB color of the points, such as:
double r = Map(i, 0, 100, 0, 255); // Re-maps a number from one range to
double g = 0;
double b = 255 - r;
cairo_set_source_rgb(c, r / 255.0, g / 255.0, b / 255.0);
cairo_move_to(c, x, y);
It is unable to put cairo_stroke into the for loop, it might be a heavy
operation when draw the path too often.
But cairo_set_source_rgb failed to take effect in the loop if
cairo_stroke was outside.
The source code is available via
So how to take cairo_set_source_rgb effect for drawing different color
Please someone give me some advice, Thanks a lot :)
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the cairo