CODE DEMO:
To use this demo copt and past the following code into form1's code
place a picture box on the form (picturebox1) . Set the properties on this picture box
Visible = False
SizeMode = Autosize
Image = browse to your image (bullet hole)
Using only the form mouse down event would only place an image if you can click the form itself. But to plcae one bullet hole image ontop of another you need to use a second event handler. the mouse down for the image.
The problem here is the XY positions reported for these events are relative to their base objects. XY on the form vs XY of the image
If you look at the code you will see how to convert the image XY to a form XY
Also note the AddHandler function. This assigns the existing event handler for the hidden picture box to the new picture that is added to the form. this is how you can get the new image to respond when you click it.
Final point. You will need to make your bullet hole with a transparent backround. This is a detail that will polish your bullet hole effect but its not required to do for the purpose of this question.
Public Class Form1
Private Sub Form1_MouseDown(ByVal sender As System.Object, _
ByVal e As System.Windows.Forms.MouseEventArgs) _
Handles MyBase.MouseDown
Dim x, y As Integer
'Get XY position on the form
x = e.X
y = e.Y
PlaceNewImage(x, y)
End Sub
Private Sub PictureBox1_MouseDown(ByVal sender As System.Object, _
ByVal e As System.Windows.Forms.MouseEventArgs) _
Handles PictureBox1.MouseDown
Dim x, y As Integer
Dim clickedImage As PictureBox
'Get XY position on the Image
x = e.X
y = e.Y
'Convert the Image XY position to a
'Form XY position
'
'expose methods and propeties of clicked image
'by copying the sender to a picturebox variable
'
clickedImage = sender
'extract the position of the image and modify the XY positions
'to crrespond to positions on the form
'
x = x + clickedImage.Left
y = y + clickedImage.Top
'Place a new image on the form using the modified XY position
PlaceNewImage(x, y)
End Sub
Private Sub PlaceNewImage(ByVal x As Integer, ByVal y As Integer)
'
Dim pb As New PictureBox
'get current mouse position
'Center picture about mouse position
pb.Top = y - (Me.PictureBox1.Height / 2)
pb.Left = x - (Me.PictureBox1.Width / 2)
'
'Copy the image from a hidden picture box
'or source file. Copying from a hidden
'picture box embeds the image in the
'program and prevents it being used by
'others or being changed.
'
pb.Image = Me.PictureBox1.Image
'Size the new picture box to the exact size of the picture
pb.SizeMode = PictureBoxSizeMode.AutoSize
'
'Assign the mouse down event handler for the new PB
AddHandler pb.MouseDown, AddressOf PictureBox1_MouseDown
'place the new picture box on the form by
'adding it to the controls collection of the form
Me.Controls.Add(pb)
pb.BringToFront() 'place new image on top of all others
'
'show the new picture
pb.Visible = True
End Sub
End Class