SubtitleEdit/libse/BmpReader.cs
2020-06-20 08:21:31 +02:00

20 lines
560 B
C#

using System;
namespace Nikse.SubtitleEdit.Core
{
public class BmpReader
{
public string HeaderId { get; }
public uint HeaderFileSize { get; }
public uint OffsetToPixelArray { get; }
public BmpReader(string fileName)
{
var buffer = System.IO.File.ReadAllBytes(fileName);
HeaderId = System.Text.Encoding.UTF8.GetString(buffer, 0, 2);
HeaderFileSize = BitConverter.ToUInt32(buffer, 2);
OffsetToPixelArray = BitConverter.ToUInt32(buffer, 0xa);
}
}
}