What I have: 1 OpenFileDialog, 1 PictureBox, 2 TextBox's
This is what I got so far, but I'm just stuck on how to have the width of the image automatically detect and put the images width in pixels in TextBox1, and the height in TextBox2.
Does anyone know how to do this, or can me with it?
Public Class Form1
Private sizew As Integer
Private sizey As Integer
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
PictureBox1.SizeMode = PictureBoxSizeMode.StretchImage
OpenFileDialog1.CheckFileExists = True
OpenFileDialog1.ShowReadOnly = False
OpenFileDialog1.Filter = "All Files|*.*|Bitmap |*.bmp;*.dib|JPEG |*.jpg;*.jpeg;*.jpe;*.jfif|TIFF |*.tif;*.tiff |PNG |*.png"
OpenFileDialog1.FilterIndex = 1
If OpenFileDialog1.ShowDialog = DialogResult.OK Then
PictureBox1.Image = Image.FromFile(OpenFileDialog1.FileName)
End If
End Sub
End Class