jimday1982
Member
I am importing a picture that needs to be resized to fit a picture box. I know I could use autosize, but that will not work in this instance. Does anyone know of a way to actually change the dimensions of a picture right after the user selects the picture to import to a specific size, such as 100 x 100. The code I currently have is below. Any help is greatly appreciated!
Code:
Private Sub btnPic_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPic.Click
Open dialog box to import a picture
With ofd
.CheckFileExists = True
.CheckPathExists = True
.Filter = "Images|*.bmp;*.tiff;*.jpg;*.jpeg;*.png;"
.Multiselect = False
.ShowHelp = False
.Title = "Select an Image"
End With
If ofd.ShowDialog() = DialogResult.OK Then
Dim tmpBMP As New Bitmap(ofd.FileName)
CoverPic.Image = tmpBMP
End If
End Sub