Hi, i need source code to create a drawing in VB.NET.
The user must be able to create shapes like rectangles, elipses and lines.
The user must also be able to add text to any place on the image he like. (some sort of text tool)
He must also be able to add hot-spots on the image where he wants it.
At the end the user must be able to save the image with all the shapes and text.
At a later stage when the user want to add or even change text or a shape he must be able to reopen the image and add or edit text and shapes and hot-spots.
If anybody know of source code i would appreciate it so much, even if anybody know of software i can buy that will help me complete this task.
i thank everybody in advance!
Kind regards
Heinrich
Loading
FroglegPosted Feb 4, 2011, 2:31 PM
Imports System.Drawing
Imports System.Drawing.Drawing2D
Public Class Form1
Dim _mouseDown As Boolean = False
Dim pt As Point
Dim myFont As Font
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
myFont = (New Font("Microsoft Sans Serif", 14, FontStyle.Regular))
End Sub
Private Sub PictureBox1_MouseDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox1.MouseDown
_mouseDown = True
End Sub
Private Sub PictureBox1_MouseMove(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox1.MouseMove
If _mouseDown = True Then
PictureBox1.Invalidate()
Dim g As Graphics = PictureBox1.CreateGraphics
g.DrawString(TextBox1.Text, myFont, Brushes.Black, e.X, e.Y)
pt = e.Location
End If
End Sub
Private Sub PictureBox1_MouseUp(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox1.MouseUp
_mouseDown = False
End Sub
Private Sub PictureBox1_Paint(ByVal sender As System.Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles PictureBox1.Paint
e.Graphics.DrawString(TextBox1.Text, myFont, Brushes.Black, pt.X, pt.Y)
End Sub
End Class
Heinrich HendriksPosted Jan 26, 2011, 12:43 AM
Suthish NairPosted Jan 25, 2011, 3:34 PM