Module GlobalDeclaration
Public myAlpha As Integer = 255
Public myUserColor As New Color()
Public myPenWidth As Single = 1
End Module
Imports System
Imports System.Drawing
Imports System.Windows.Forms
Public Class frmPaint
Inherits System.Windows.Forms.Form
Dim mousePath As New System.Drawing.Drawing2D.GraphicsPath()
Private Sub pbOmni_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles pbOmni.MouseDown
If e.Button = MouseButtons.Left Then
mousePath.StartFigure()
End If
End Sub
Private Sub pbOmni_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles pbOmni.MouseMove
If e.Button = MouseButtons.Left Then
Try
mousePath.AddLine(e.X, e.Y, e.X, e.Y)
Catch
MsgBox("Mouse Error")
End Try
End If
pbOmni.Invalidate()
End Sub
Private Sub pbPaint_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles pbPaint.Paint
Try
myUserColor = (System.Drawing.Color.Black)
Dim CurrentPen = New Pen(Color.FromArgb(myAlpha, myUserColor), myPenWidth)
e.Graphics.DrawPath(CurrentPen, mousePath)
Catch
End Try
End Sub

New Topic/Question
Reply




MultiQuote





|