I want draw line like spray gun effect.

212 views
Skip to first unread message

啊源股

unread,
Jan 8, 2019, 1:55:43 AM1/8/19
to skia-discuss
hi ,

   I want draw line like spray gun effect. please see the picture.

spray gun.png




   I have two point, p1 and p2,  if I using API drawLine, it will connect as a straight  line, now I want using other API to connect two line as spray gun effect.



Best Regards!

Shawn Riordan

unread,
Jan 8, 2019, 9:37:43 AM1/8/19
to skia-discuss
If you came up with an image that contained a noise pattern, like the one you are showing, then you could stroke a wide line with that pattern.
Message has been deleted

啊源股

unread,
Jan 11, 2019, 2:20:32 AM1/11/19
to skia-discuss
hi Shawn,

Could you please provide me a more specific guide?  thank you very much. I am not good at english communication, give me a teach link will be much better.  thank you.



在 2019年1月8日星期二 UTC+8下午10:37:43,Shawn Riordan写道:

Hal Canary

unread,
Jan 11, 2019, 9:17:35 AM1/11/19
to skia-discuss

--
You received this message because you are subscribed to the Google Groups "skia-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to skia-discuss...@googlegroups.com.
To post to this group, send email to skia-d...@googlegroups.com.
Visit this group at https://groups.google.com/group/skia-discuss.
For more options, visit https://groups.google.com/d/optout.

sha...@infograph.com

unread,
Jan 11, 2019, 5:43:47 PM1/11/19
to skia-discuss
Something like this


except don't use such a small noise image.  Use one that is 128x128 or so. Like this:
That way the pattern won't repeat as frequently.

Also, I set the scale to 3.0 so that you could see the pixels more clearly.  Real world case would use 1.0.

sha...@infograph.com

unread,
Jan 11, 2019, 6:16:23 PM1/11/19
to skia-discuss

A better noise image:

noise.png

Shawn Riordan

unread,
Jan 12, 2019, 2:07:52 AM1/12/19
to skia-discuss
https://fiddle.skia.org/c/58a66f221af0f33fe9d5500865eb8c2e

Someone make me stop...
I have other things to work on.
But I keep thinking about this...
Help!


On Monday, January 7, 2019 at 11:55:43 PM UTC-7, 啊源股 wrote:

Florin Malita

unread,
Jan 12, 2019, 9:41:23 PM1/12/19
to skia-d...@googlegroups.com
On Sat, Jan 12, 2019 at 2:07 AM Shawn Riordan <craste...@gmail.com> wrote:

You're asking the wrong crowd -- this is awesome! :)

 
I have other things to work on.
But I keep thinking about this...
Help!


On Monday, January 7, 2019 at 11:55:43 PM UTC-7, 啊源股 wrote:
hi ,

   I want draw line like spray gun effect. please see the picture.

spray gun.png




   I have two point, p1 and p2,  if I using API drawLine, it will connect as a straight  line, now I want using other API to connect two line as spray gun effect.



Best Regards!

--

Hal Canary

unread,
Jan 14, 2019, 9:45:01 AM1/14/19
to skia-discuss
Your makeNoiseMask() function could be even simpler:
    https://fiddle.skia.org/c/ec81078790989b476b8a07e4be55d961

--
Reply all
Reply to author
Forward
0 new messages