Skia custom brushes

231 views
Skip to first unread message

Adrian F

unread,
Sep 20, 2023, 4:28:58 PM9/20/23
to skia-discuss
Hi, I'm trying to implement a drawing application using Visual Studio's Window Forms Applications. I decided to go with Skia for the drawing logic and I have been struggling to implement 'custom brushes'. Essentially I want to be able to create different types of brushes like the Microsoft Paint program, but I haven't been able to find much information online. The best I've been able to do is use an SKShader ( with a png bitmap ), in the SKPaint object and then using this paint object in the Canvas.Draw() method, but the behavior is more like the bitmap is being revealed rather than actually 'drawing' with the bitmap. I hope that makes sense and I would appreciate any advice that'll point me in the right direction (if this is even possible with Skiasharp), thanks!

craste...@gmail.com

unread,
Sep 20, 2023, 5:17:45 PM9/20/23
to skia-discuss
This old conversation might be relevant to what you want:

Adrian F

unread,
Sep 20, 2023, 5:50:32 PM9/20/23
to skia-discuss
It's close. From what I can tell from the conversation and the images provided, when you draw a line using the noise mask, drawing would essentially reveal the mask underneath. I want it so that I actually draw with the noise mask. Instead of revealing I would like it draw with the noise mask texture. Otherwise, I think if you drew on the entire canvas it would look exactly like the noise mask image, correct me if I'm wrong.
Reply all
Reply to author
Forward
0 new messages