Post by bobowk on Jul 25, 2016 16:13:54 GMT 10
I have tried countless times to attempt a paint application in VB.net and sadly Nathan Lecompte hasn't happened to make a tutorial (or I do not know of it). y problem is that when I use this: if draw =true then
PictureBox1.CreateGraphics.DrawEllipse(Pens.Black, e.X, e.Y, 10, 10) end if It makes the ellipse, but it doesn't seem to keep up with the mouse thus making this:
|
|
Post by Nathan Lecompte on Jul 25, 2016 16:49:19 GMT 10
Hahaha, I actually made a paint program a while back called Lumia Splash; I was working on a massive update but it got a little out of hand (waaaaaaayyyy to messed up and un-organised code, it was almost impossible to figure out what was going on). I think I solved this by just using the DrawLine method rather than the DrawEllipse method (since the "lag" does become an issue), however to make the line drawing smoother I also set the Pen Caps to rounded to avoid the ugliness that was the Lumia Splash pen . Basically like this (you can also change different properties of the pen, such as width and so on): Dim MyBrush As New Pen(Brushes.Black) MyBrush.StartCap = LineCap.Round MyBrush.EndCap = LineCap.Round PictureBox1.CreateGraphics.DrawLine(MyBrush, e.X, e.Y, 10, 10)
|
|
Post by bobowk on Jul 25, 2016 17:09:12 GMT 10
Now what happens is that it creates a line when I mouse up and then mouse down again :/
|
|
Post by bobowk on Jul 25, 2016 17:26:26 GMT 10
|
|
Post by Nathan Lecompte on Jul 26, 2016 12:15:44 GMT 10
Oh oops, yeah I forgot to change the points (I kinda wrote it late at night); I'll fix it and test it in a bit
|
|
Post by bobowk on Dec 3, 2016 20:53:25 GMT 10
|
|
Post by knowledge on Dec 3, 2016 21:09:37 GMT 10
|
|
Post by Nathan Lecompte on Dec 4, 2016 9:50:22 GMT 10
I remember my paint program being based off of some tutorial which used the same method to draw but then I just smoothed everything out (added rounded caps and set the smoothing to anti-alias), I found it on my old computer here (it's REALLY old (VS 2008 old) so you may have to convert some things over manually to make it work with newer versions of VS): Advanced Paint Program.zip (165.24 KB) I might make a small tutorial based off of this old one and revive it with some newer features...that is, when I have time of course (which shouldn't be long now, almost holidays!!!).
|
|