Imports System
Imports System.IO
Public Class PCXreader
Public Shared Sub Main()
Dim myFile As BinaryReader
myFile = New BinaryReader(File.Open("1.pcx", FileMode.Open))
Dim mark As Byte = myFile.ReadByte()
If mark <> 10 Then
Console.WriteLine("Not a PCX file!")
Else
myFile.BaseStream.Seek(4, SeekOrigin.Begin)
Dim xMin As Short = myFile.ReadInt16()
Dim yMin As Short = myFile.ReadInt16()
Dim xMax As Short = myFile.ReadInt16()
Dim yMax As Short = myFile.ReadInt16()
Console.WriteLine("Width: " & (xMax - xMin + 1))
Console.WriteLine("Height: " & (yMax - yMin + 1))
End If
myFile.Close()
End Sub
End Class