In VB.net I need to read through a folder full of images and get their: File name, Height in pixels and Width in pixels and assign their values to individual variables.
thanks.
Mike.
Try this:
Imports System.IO
Imports System.Drawing
Module Module1
Sub Main()
Dim s As New DirectoryInfo("C:/Files")
Dim files As FileInfo() = s.GetFiles("*.jpg")
For Each f As FileInfo In files
Dim bmp As New Bitmap(f.FullName)
Console.WriteLine("Width: " & bmp.Width.ToString() + " > Height: " & bmp.Height.ToString())
Next
Console.Read()
End Sub
End Module
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With