jimday1982
Member
I was wondering if anyone knows of a way to specify the size of an image on import into my program. For instance, if the user imports a 500 x 500 picture, i need it to fit my 100x100 picture box. I know about the autosize property and all that, but there are more operations that are going to be associated with the picture box that make autosize impossible to use. The code I have for importing the pictures is below. Thanks for your help!!
Code:
Private Sub b101clicksub(ByVal sender As System.Object, ByVal e As System.EventArgs)
With ofd51
.CheckFileExists = True
.CheckPathExists = True
.Filter = "Images|*.bmp;*.tiff;*.jpg;*.jpeg;*.png;"
.Multiselect = False
.ShowHelp = False
.Title = "Select an Image"
End With
If ofd51.ShowDialog() = DialogResult.OK Then
Dim tmpBMP As New Bitmap(ofd51.FileName)
gp51.Image = tmpBMP
End If
End Sub