تقييم الموضوع :
  • 0 أصوات - بمعدل 0
  • 1
  • 2
  • 3
  • 4
  • 5
خاصية السحب و الإفلات للصور
#4
تفضل اخي وعذرآ عالتأخير شويا القياسات كانت متعبة وبالنسبة لقياسات الصورة انا عملتها على قياسات العندي اذا صارت عندك مشكلة فقط غير القياسات

الكود عملته عن طريق الرسم واذا اردت تحريك الصورة ايضآ عند نقلها حتى اغير الكود وما اعمله عن طريق الرسم



كود :
Dim x, y As Integer
   Dim wid As Integer = 0
   Private Sub PictureBox_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox3.MouseDown, PictureBox2.MouseDown, PictureBox4.MouseDown
       Clipboard.SetImage(CType(sender, PictureBox).Image)
       x = e.X : y = e.Y
       Cursor = Cursors.NoMove2D
   End Sub

   Private Sub PictureBox_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox3.MouseUp, PictureBox2.MouseUp, PictureBox4.MouseUp
       Dim gr As Graphics = PictureBox1.CreateGraphics
       If sender Is PictureBox2 Then
           gr.DrawImage(Clipboard.GetImage, wid + e.X, e.Y - 12, 40, 40)
       ElseIf sender Is PictureBox3 Then
           gr.DrawImage(Clipboard.GetImage, wid + e.X, e.Y + PictureBox3.Location.Y - 24, 40, 40)
       ElseIf sender Is PictureBox4 Then
           gr.DrawImage(Clipboard.GetImage, wid + e.X, e.Y + PictureBox4.Location.Y - 24, 40, 40)
       End If
       Cursor = Cursors.Default
   End Sub

   Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
       wid = PictureBox1.Width
   End Sub
الرد }}}
تم الشكر بواسطة: asemshahen5


الردود في هذا الموضوع
RE: خاصية السحب و الإفلات للصور - بواسطة 3booody - 04-11-19, 12:10 PM


التنقل السريع :


يقوم بقرائة الموضوع: بالاضافة الى ( 1 ) ضيف كريم