Hey guys,
I have a PictureBox control that will display an image that the end user specifies, and then position this image in the very center of the PictureBox (as it's background image). The width & height of these background images will vary, but they will always be smaller than the PictureBox.
What I would like to do is... each time that the user clicks button1, the background image position should move down 1 pixel inside the PictureBox. But the PictureBox itself should not move (otherwise I could solve this problem simply by adjust the PictureBox's top-margin inside it's parent container).
For example... I know that there is not a "top" property specifically for a PictureBox's background image, but if there was, then I would want to do something like this...
So... any ideas how to accomplish something like this?
I have a PictureBox control that will display an image that the end user specifies, and then position this image in the very center of the PictureBox (as it's background image). The width & height of these background images will vary, but they will always be smaller than the PictureBox.
What I would like to do is... each time that the user clicks button1, the background image position should move down 1 pixel inside the PictureBox. But the PictureBox itself should not move (otherwise I could solve this problem simply by adjust the PictureBox's top-margin inside it's parent container).
For example... I know that there is not a "top" property specifically for a PictureBox's background image, but if there was, then I would want to do something like this...
Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If PictureBox1.BackgroundImage IsNot Nothing Then
PictureBox1.BackgroundImage.Top += 1
End If
End Sub