I want to load a .gif image with no background at the pointer's location on the form every time the user clicks on the form.
I tried using a picturebox but when two of this same image overlap the background of the picturebox covers the image behind..
How can i do this using GDI+ ?
Dim PB As New PictureBox
With PB
.Name = "Bullet"
.Image = bullet
.Size = New Size(42, 39)
.SizeMode = PictureBoxSizeMode.StretchImage
.BackColor = System.Drawing.Color.Transparent
.Location = New Point(Me.PointToClient(Cursor.Position).X - PB.Width / 2, Me.PointToClient(Cursor.Position).Y - PB.Height / 2)
End With
Me.Controls.Add(PB)
PB.BringToFront()
End If
I tried using a picturebox but when two of this same image overlap the background of the picturebox covers the image behind..
How can i do this using GDI+ ?
Dim PB As New PictureBox
With PB
.Name = "Bullet"
.Image = bullet
.Size = New Size(42, 39)
.SizeMode = PictureBoxSizeMode.StretchImage
.BackColor = System.Drawing.Color.Transparent
.Location = New Point(Me.PointToClient(Cursor.Position).X - PB.Width / 2, Me.PointToClient(Cursor.Position).Y - PB.Height / 2)
End With
Me.Controls.Add(PB)
PB.BringToFront()
End If