[cairo] can cairo give me a draw pen with gradient width

Peter Groves pdgroves at gmail.com
Tue Dec 11 20:29:29 PST 2007


On Wed, 12 Dec 2007 12:16:04 +0800
"glorious tao" <glorioustao at gmail.com> wrote:


> yes,  that was exactly what I thought before. Yesterday night I tried this
> idea, and it looked not very good. I think maybe the problems are 1) I
> choose a bad math function width = C / speed. 2) when I use mouse to write,
> I can't move the mouse smoothly, so the speed changed not smoothly. 3) when
> I use brush pen, the pen pressure is changing, that will affect the line
> width. But with mouse, I can't do that.

could you use the scroll wheel to control the "brush pressure?" instead of 
drawing when the mouse button is pressed and stopping when it's released, you
could imagine a brush floating just above the painting surface. Scrolling down with
the mouse wheel would press the brush to the screen, scrolling back up would
lift it off the painting surface. therefore scrolling down a lot would create a 
fat brush stroke and scrolling down a little would create a thin stroke.

it would probably be difficult to make this work very well.

good luck,
peter 


More information about the cairo mailing list