Engines/FlatRedBallXNA/FlatRedBall/IO/BmpLoader.cs
/// <summary>
/// ImageData takes a fileName (string) and loads the BMP from the file. 
/// </summary>
/// <param name="fileName"></param>
/// <returns>a new ImageData, containing the width, height, and data of the BMP that was loaded</returns>
ImageData takes a fileName (string) and loads the BMP from the file.
ImageData takes a fileName ( string ) and loads the BMP from the file .
public static ImageData GetPixelData(string fileName)
        {
            Stream sourceStream = new MemoryStream(LoadFile(fileName));
            if (!CheckSignature(ref sourceStream))
                throw new ArgumentException(
                    String.Format("Argument Stream {0} does not contain a valid BMP file.", sourceStream));
            BMPHeader bmpHeader = new BMPHeader();
            ParseBytes(ref sourceStream, ref bmpHeader);
            FileManager.Close(sourceStream);
            return new ImageData((int)bmpHeader.Width, (int)bmpHeader.Height, bmpHeader.Pixels);
        }
public static ImageData GetPixelData ( string fileName ) { Stream sourceStream = new MemoryStream ( LoadFile ( fileName ) ) ; if ( ! CheckSignature ( ref sourceStream ) ) throw new ArgumentException ( String . Format ( " " , sourceStream ) ) ; BMPHeader bmpHeader = new BMPHeader ( ) ; ParseBytes ( ref sourceStream , ref bmpHeader ) ; FileManager . Close ( sourceStream ) ; return new ImageData ( ( int ) bmpHeader . Width , ( int ) bmpHeader . Height , bmpHeader . Pixels ) ; }
ImageData takes a fileName (string) and loads the BMP from the file.
ImageData takes a fileName ( string ) and loads the BMP from the file .
//Load the file into "byte stream" //Check the signature to verify this is an actual .bmp image
a new ImageData, containing the width, height, and data of the BMP that was loaded
a new ImageData containing the width height and data of the BMP that was loaded
fileName
string
None