I learned a little and, apparently, moved the image to the PictureBox, not an easy task, at least I could not find anything that could make this possible (without saying that there is no way to do it though).
However, I came up with a bit of a βworkaroundβ to see if this fits your needs. For this:
- Create a Panel control and place it on any part of the image that you would like to display
- Inside this panel, set the PictureBox control with the image in it and set the SizeMode property to AutoSize.
Now enter this code in your form
private bool Dragging; private int xPos; private int yPos; private void pictureBox1_MouseUp(object sender, MouseEventArgs e) { Dragging = false; } private void pictureBox1_MouseDown(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Left) { Dragging = true; xPos = eX; yPos = eY; } } private void pictureBox1_MouseMove(object sender, MouseEventArgs e) { Control c = sender as Control; if (Dragging && c!= null) { c.Top = eY + c.Top - yPos; c.Left = eX + c.Left - xPos; } }
Now, when you click and drag the PictureBox, in fact it does not move the image inside it, but the PictureBox control inside the panel. Again, not exactly what you were looking for, and I'm not sure how it will convert to Kinect, but I hope this helps you on the right track.
source share