So what I'm trying to figure out is a way to program this fading line on mouse down for my c# winform paint app (like in the sample picture), but I haven't found any possible way to do this. Does anyone have any ideas for this one? thanks!
Asked
Active
Viewed 72 times
1
-
I’m voting to close this question because it is unrelated to programming. – Robert Harvey Feb 13 '22 at 15:25
-
You could collect the points in the mousemove event maybe in a timer tick and then use a changing number of brushes or pens, maybe with decreasing opacity to draw each segment. - What is best will depend on what you want: A dynamic, live line or just the effect afterwards. – TaW Feb 13 '22 at 15:47
-
When I think of it, there may be artifacts when overlaying semitransparent strokes with a width > 1. Maybe fading to white would be easier, but obviously not quite correct.. - This may be a bit hard for beginners. – TaW Feb 13 '22 at 15:57
-
1You may want to study [this old post](https://stackoverflow.com/questions/49290951/creating-different-brush-patterns-in-c-sharp/49298313#49298313) which is not using drawcurve but DrawImage. With a suitable list of fading images it should work by using a time index to create the fade.. – TaW Feb 13 '22 at 18:25
-
There's nothing built in for this. You'll have to implement the effect entirely on your own via a timer to repeatedly invalidate the control window and your own draw commands in the control's OnPaint. – Joel Coehoorn Feb 14 '22 at 15:27