I want to get the width & height of the image file..

Mine code is currently getting the file size, I also want to get the width & height.How to get width & height,kindly help me.

Imports System.IO

Public Class Form1
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Try
            Dim sFileSize As String
            Dim FS As System.IO.FileInfo = New System.IO.FileInfo("C:\Documents and Settings\Mansi\Desktop\Image.jpg")
            sFileSize = FS.Length.ToString
            MsgBox(sFileSize)

        Catch ex As Exception
            MsgBox(ex.Message)
        End Try
    End Sub

You have two sets of sizes for a picture --- the physical size of the image (if you were to print it and not grow/shrink/stretch the image) and the pixel size.

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
		Dim fName As String = "C:\picture.bmp"
		Dim img As Image = Image.FromFile(fName)
		Dim pixelHeight As Integer = img.Size.Height
		Dim pixelWidth As Integer = img.Size.Width
		Dim physicalHeight As Decimal = img.Size.Height / img.VerticalResolution
		Dim physicalWidth As Decimal = img.Size.Width / img.HorizontalResolution
		System.Diagnostics.Debugger.Break()
		img.Dispose()
	End Sub
This question has already been answered. Start a new discussion instead.