Private lastmouselocation As New Point Private Sub PictureBox1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs)Handles PictureBox1.MouseMove Dim pt As New Point pt = e.Location If e.Button = Windows.Forms.MouseButtons.Left Then pt.X = (pt.X + DirectCast(sender, PictureBox).Left) - lastmouselocation.X pt.Y = (pt.Y + DirectCast(sender, PictureBox).Top) - lastmouselocation.Y DirectCast(sender, PictureBox).Location = pt DirectCast(sender, PictureBox).BringToFront() End If End Sub Private Sub PictureBox1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs)PictureBox1.MouseDown lastmouselocation = e.Location End Sub
Private Sub JoinImage() Try Dim imageproduct As Bitmap = Image.FromFile(Application.StartupPath & "\bert.jpg") Dim imageproduct2 As Bitmap = Image.FromFile(Application.StartupPath & "\ernest.jpg") Dim size1, size2, sizefinal As New Size size1 = imageproduct.Size size2 = imageproduct2.Size sizefinal.Height = size1.Height + size1.Height sizefinal.Width = size1.Width Dim imgFinal As New Bitmap(sizefinal.Width, sizefinal.Height) Dim gfx As Graphics = Graphics.FromImage(imgFinal) gfx.Clear(Color.White) gfx.DrawImage(imageproduct, 0, 0, New Rectangle(0, 0, size1.Width, size1.Height), GraphicsUnit.Pixel) gfx.DrawImage(imageproduct2, New Point(0, size1.Height)) imgFinal.Save(Application.StartupPath & "\twoimage.jpg", ImageFormat.Jpeg) Catch ex As Exception MessageBox.Show(ex.Message) End Try End Sub
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionVous n'avais pas une idée pour solutionner mon probléme ?
Ajouter des images sur une image de base