C-Sharp | Java | Python | Swift | GO | WPF | Ruby | Scala | F# | JavaScript | SQL | PHP | Angular | HTML
Tip: The Image type is an abstract data type that represents an image. It returns Width and Height and other information about an image.
Also: The Image type stores the image's data in memory after it is read in from the disk.
VB.NET program that opens Image
Imports System.Drawing
Module Module1
Sub Main()
' Load Image from file.
Dim i As Image = Image.FromFile("C:\background1.png", False)
' Print dimensions of Image.
Console.WriteLine(i.Width)
Console.WriteLine(i.Height)
Console.WriteLine(i.PhysicalDimension)
End Sub
End Module
Output
180
110
{Width=180, Height=110}
Warning: The Image type does not handle all image formats. It works on many popular formats such as PNG and JPG.