مثال بسيط حول اضافة ادوات تسمية الى مربع الصورة والتحكم باماكنها وقت التشغيل ويمكن التعديل واضافة المزيد
المشروع مرفق
PHP كود :
Public Class Form1
Dim i As Integer = 0
Dim ax, ay As Integer, dr As Boolean
Private Sub lblmouseenter(sender As Object, e As EventArgs)
Dim l As Label = DirectCast(sender, Label)
l.Cursor = Cursors.SizeAll
End Sub
Private Sub lblmouseleave(sender As Object, e As EventArgs)
Dim l As Label = DirectCast(sender, Label)
l.Cursor = Cursors.Default
End Sub
Private Sub lblmousedown(sender As Object, e As MouseEventArgs)
Dim l As Label = DirectCast(sender, Label)
If e.Button = MouseButtons.Left Then
dr = True
ax = MousePosition.X - l.Left
ay = MousePosition.Y - l.Top
End If
End Sub
Private Sub lblmousemove(sender As Object, e As MouseEventArgs)
Dim l As Label = DirectCast(sender, Label)
If dr Then
l.Left = MousePosition.X - ax
l.Top = MousePosition.Y - ay
End If
End Sub
Private Sub lblmouseup(sender As Object, e As MouseEventArgs)
dr = False
End Sub
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
Dim sfd As New SaveFileDialog
sfd.Filter = "Png|*.Png"
If sfd.ShowDialog = DialogResult.OK Then
Dim w As Integer = (PictureBox1.Width)
Dim h As Integer = (PictureBox1.Height)
Dim bmp As New Bitmap(w, h)
Dim g As Graphics = Graphics.FromImage(bmp)
Dim n As New Point(0, 0)
Dim s As New Size(bmp.Width, bmp.Height)
g.CopyFromScreen(PictureBox1.PointToScreen(n), n, s)
bmp.Save(sfd.FileName, System.Drawing.Imaging.ImageFormat.Png)
End If
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim lbl As New Label
lbl.Name = "lbl" & i
lbl.Font = TextBox1.Font
lbl.AutoSize = True
lbl.Text = TextBox1.Text
lbl.ForeColor = TextBox1.ForeColor
AddHandler lbl.MouseDown, AddressOf lblmousedown
AddHandler lbl.MouseMove, AddressOf lblmousemove
AddHandler lbl.MouseUp, AddressOf lblmouseup
AddHandler lbl.MouseEnter, AddressOf lblmouseenter
AddHandler lbl.MouseLeave, AddressOf lblmouseleave
' PictureBox1.CreateGraphics().DrawString(TextBox1.Text, TextBox1.Font, Brushes.Red, New PointF((PictureBox1.Width / 2), 0))
' PictureBox1.CreateGraphics().Drawo(TextBox1.Text, TextBox1.Font, Brushes.Red, New PointF((PictureBox1.Width / 2), 0))
PictureBox1.Controls.Add(lbl)
i += 1
End Sub
End Class
اللهم إني أعوذ بك من غلبة الدين وغلبة العدو، اللهم إني أعوذ بك من جهد البلاء ومن درك الشقاء ومن سوء القضاء ومن شماتة الأعداء
اللهم اغفر لي خطيئتي وجهلي، وإسرافي في أمري وما أنت أعلم به مني، اللهم اغفر لي ما قدمت وما أخرت، وما أسررت وما أعلنت وما أنت أعلم به مني، أنت المقدم وأنت المؤخر وأنت على كل شيء قدير

