I have an image in a picture box. I want a user to be able to drag from a tree view onto my picture. When he does this, the image that I have assigned to the treeNode will be displayed at the coodinates of the mouse. Can anyone tell me how I can get access to the bitmap that is associated with the node, and then how to display it in my Picture box, on top of the image that I have there already. I also want to be able to move the different images that I put there. I have tried to do this, but the closest I get is to have the drop look like its working over the picture box, but nothing drops. Here is the code that I have for the OnDrop.
private void OnPictureDrop(object sender, System.Windows.Forms.DragEventArgs e)
{
Bitmap b = new Bitmap(@"c:\\bitmap1.bmp");
Graphics g = pictureBox1.CreateGraphics();
g.DrawImage(b,e.X,e.Y);
g.Dispose();
}
Cheers,
JJ
private void OnPictureDrop(object sender, System.Windows.Forms.DragEventArgs e)
{
Bitmap b = new Bitmap(@"c:\\bitmap1.bmp");
Graphics g = pictureBox1.CreateGraphics();
g.DrawImage(b,e.X,e.Y);
g.Dispose();
}
Cheers,
JJ