Hi! It seems I have ran into a small problem. How can you draw an image to a picturebox at the mouse's pointer location. If image can be centered there, that would be
great! Thanks for any help!
Hi! It seems I have ran into a small problem. How can you draw an image to a picturebox at the mouse's pointer location. If image can be centered there, that would be
great! Thanks for any help!
Er ... that doesn't really make sense. What exactly are you trying to do?
I am trying to draw an image on top of the background at a certain location. Is this possible with a picturebox, or do I need another control?
You'll need to decide where to put the various bits of this but this is the basic code you need.
vb.net Code:
Dim pic As Bitmap = New Bitmap("filename") Dim g As Graphics = Graphics.FromHwnd(PictureBox1.Handle) g.DrawImage(pic, New Rectangle(sender.PointToClient(MousePosition).X - pic.Width / 2, sender.PointToClient(MousePosition).Y - pic.Height / 2, pic.Width, pic.Height))
Thanks a ton!![]()