Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
'Dim resizeimg As Image
Try
Dim digiImage As FileDialog = New OpenFileDialog()
digiImage.Filter = "Image File (*.jpg;*.bmp;*.gif)|*.jpg;*.bmp;*.gif"
If digiImage.ShowDialog() = DialogResult.OK Then
imgName = digiImage.FileName
Dim newimg As New Bitmap(imgName)
PictureBox1.SizeMode = PictureBoxSizeMode.StretchImage
PictureBox1.Image = DirectCast(newimg, Image)
End If
digiImage = Nothing
Catch ae As System.ArgumentException
imgName = " "
MessageBox.Show(ae.Message.ToString())
Catch ex As Exception
MessageBox.Show(ex.Message.ToString())
End Try
End Sub
ขอบคุณครับ
Tag : .NET, Ms Access, Crystal Report, VB.NET, Windows