Digg StumbleUpon LinkedIn YouTube Flickr Facebook Twitter RSS Reset

Adapter un BitMap au Contenu d’un fichier

Modifier,le,mode,de,composition,d'une,image
{filelink=16682}

using System;
using System.IO;
 
class LireFichierEtBitMap {
    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();
        }
    }
}

No comments yet.

Leave a Comment