Center image in picture box?
-
I have the following simple code to place a background image and an animated image in a picture box. How can I get the animated image to be centered in the picture box? Dim myPBImage As Bitmap = New Bitmap("Dog.gif") Dim myPBBkgrd As Bitmap = New Bitmap("BackYardBkgrd.jpg") PictureBox1.BackgroundImage = CType((myPBBkgrd), System.Drawing.Image) ImageAnimator.Animate(myPBImage, New EventHandler(AddressOf OnFrameChange)) PictureBox1.Image = CType((myPBImage), System.Drawing.Image)
-
I have the following simple code to place a background image and an animated image in a picture box. How can I get the animated image to be centered in the picture box? Dim myPBImage As Bitmap = New Bitmap("Dog.gif") Dim myPBBkgrd As Bitmap = New Bitmap("BackYardBkgrd.jpg") PictureBox1.BackgroundImage = CType((myPBBkgrd), System.Drawing.Image) ImageAnimator.Animate(myPBImage, New EventHandler(AddressOf OnFrameChange)) PictureBox1.Image = CType((myPBImage), System.Drawing.Image)