Support Forums

Full Version: Help with Snippet/paint.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm making a type of "Snippet" program that takes a screenshot of your, well screen obviously. Right now I have a capture, clear, and save button.
After the screenshot is captured I want to be able to Freehand draw on it but I can't seem to figure out how.
So far I have a small idea but I don't know what to do with it.
Underneath the public class-

Dim q As System.Drawing.Graphics

And in the picture box

Private Sub PictureBox1_MouseDown(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox1.MouseDown
q.Draw....

But I don't know how to make it freehand on MouseDown.
(04-23-2011, 06:08 PM)Aero Wrote: [ -> ]I'm making a type of "Snippet" program that takes a screenshot of your, well screen obviously. Right now I have a capture, clear, and save button.
After the screenshot is captured I want to be able to Freehand draw on it but I can't seem to figure out how.
So far I have a small idea but I don't know what to do with it.
Underneath the public class-

Dim q As System.Drawing.Graphics

And in the picture box

Private Sub PictureBox1_MouseDown(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox1.MouseDown
q.Draw....

But I don't know how to make it freehand on MouseDown.

What do you mean by "freehand", do you mean when the mouse it attempting to draw on the picture or when it has already drawn on the picture?

Just like in paint. Left click and draw. No straight lines or circles or squares.
Hmmm. Sounds like this could turn out pretty cool if you figure it out. Good luck.
This is not the best way to do it.. but for the sake of simplicity I think this will work for you. Adjust the code accordingly to fit your needs

Code:
Public Class Form1
    Dim mDown As Boolean = False
    Private Sub PictureBox1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox1.MouseDown
        mDown = True
    End Sub
    Private Sub PictureBox1_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox1.MouseUp
        mDown = False
    End Sub
    Private Sub PictureBox1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox1.MouseMove
        If mDown Then
            Me.Text = "down"
        Else
            Me.Text = "up"
        End If
    End Sub
End Class
Check this out: http://www.dreamincode.net/forums/topic/...t-program/
Do not copy and paste! Learn from it!