AdvancedHMI Software

General Category => Tips & Tricks => Topic started by: Godra on January 21, 2015, 03:43:09 PM

Title: Freehand Drawing on the main form
Post by: Godra on January 21, 2015, 03:43:09 PM
If anyone might find it useful here is a link for video that shows the code:

https://www.youtube.com/watch?v=U0Z1IEOFGe4  (change pen color to some other than black since AHMI screen is usually black)

And if you ad the same "If" loop but for the Right mouse button and change the code to:

Me.CreateGraphics.DrawLine(New Pen(Me.BackColor, 60), last.X, last.Y, e.X, e.Y)

then you can erase the lines when holding the right mouse button down.

This freehand drawing didn't  go over or affect the controls on my form and could be used for presentation purposes or similar.
Don't get surprised if a certain control does get affected by this drawing.