Different paint brush types in drawing app using flutter.

782 views
Skip to first unread message

Manusb

unread,
Aug 7, 2018, 2:17:07 AM8/7/18
to Flutter Dev
Hi All,

I want to add different paint brushes for drawing app using flutter. Now I'm using only stroke width for brush type and I want different kind of brush types like pencil,crayon. marker. Is there any suggestion?

Thank you

 regards,
 Manu

Eric Seidel

unread,
Aug 7, 2018, 5:28:50 PM8/7/18
to Manusb, Flutter Dev
I suspect that brushes are just images which are composited (repeatedly) onto another image (the "layer" your painting on).

If that's true, you could just make repeated drawImage calls:
on a PictureRecorder, out of which you occasionally pull an Image:

And then you can composite the various produced Images together to produce your final image.

But that's just me wildly guessing.  I've never actually written an app like that.  But an approach similar to the above is what I'd try first.  I suspect someone has asked similar questions on stack overflow (for other languages/libraries) or there are example open source painting apps you could study and recreate similar techniques using Flutter.

Hope that helps.


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

Manusb

unread,
Aug 9, 2018, 6:19:48 AM8/9/18
to Flutter Dev
Yeah it works using DrawImage() thanks for ur response.

Nitin Janyani

unread,
Jun 14, 2021, 10:56:03 AM6/14/21
to Flutter Development (flutter-dev)
Manusb, Can you please share the solutions.
I'm also trying the same.

Reply all
Reply to author
Forward
0 new messages