Read Bitmap Size by using BinaryReader : Bitmap : Graphics C# Source Code


Custom Search

C# Source Code » Graphics » Bitmap »

 

Read Bitmap Size by using BinaryReader








    
 


using System;
using System.IO;


class Class1 {
    static void Main(string[] args) {
        string[] cma = Environment.GetCommandLineArgs();

        if (cma.GetUpperBound(0) >= 1) {
            FileStream myFStream = new FileStream(cma[1], FileMode.Open, FileAccess.Read);
            BinaryReader binRead = new BinaryReader(myFStream);
            binRead.BaseStream.Position = 0x12;
            
            Console.WriteLine(binRead.ReadInt32());
            Console.WriteLine(binRead.ReadInt32());
            Console.WriteLine(binRead.ReadInt16());
            Console.WriteLine(binRead.ReadInt16());

            binRead.Close();
            myFStream.Close();
        }
    }
}

 
    
   
  
   







HTML code for linking to this page:

Follow Navioo On Twitter

C# Source Code

 Navioo Graphics
» Bitmap