hello all, I am trying to create a radial gradiant ellipse to create a soft brush for a simple paint app im making. ive searched the crap out of gradients for VB.NET and all i can come up with is stuff for buttons and form backgrounds etc.
i currently draw my round (ellipse) brushes with the following:
in the mousedown and mousemove events
in the mouse up it sets my canpaint variable to false and saves picturebox1 to a bitmap object type so that i do not lose the drawing when the app is minimized etc.
its pretty late so this might now make sense, but im looking for a way i can plug in a new boolean var i.e. isGradient and if its true draw a radial gradient ellipse instead of the solid.
also while im here instead of creating a new thread later... ive been trying to think of a logical way to create solid lines when the mouse is moved fast... currently if the user moves the mouse too fast they get seperated dots and not a solid path. i was thinking of logging all of the mouse x,y coords to an array while the mouse is moving and then on mouse up calling a function that takes these coords and compares them one element at a time and if theres a gap of more than 2 to fill it in, but i dont think this would be the easiest/smartest/best way to go about that.
thanks in advance for any info/suggestions.
i currently draw my round (ellipse) brushes with the following:
Code:
PictureBox1.CreateGraphics.FillEllipse(New SolidBrush(Color.FromArgb(VScrollBar1.Value, VScrollBar2.Value, VScrollBar3.Value)), e.X, e.Y, HScrollBar1.Value, HScrollBar1.Value)
in the mousedown and mousemove events
in the mouse up it sets my canpaint variable to false and saves picturebox1 to a bitmap object type so that i do not lose the drawing when the app is minimized etc.
its pretty late so this might now make sense, but im looking for a way i can plug in a new boolean var i.e. isGradient and if its true draw a radial gradient ellipse instead of the solid.
also while im here instead of creating a new thread later... ive been trying to think of a logical way to create solid lines when the mouse is moved fast... currently if the user moves the mouse too fast they get seperated dots and not a solid path. i was thinking of logging all of the mouse x,y coords to an array while the mouse is moving and then on mouse up calling a function that takes these coords and compares them one element at a time and if theres a gap of more than 2 to fill it in, but i dont think this would be the easiest/smartest/best way to go about that.
thanks in advance for any info/suggestions.