Engines/FlatRedBallXNA/FlatRedBall/IO/PngLoader.cs
/// <summary>
/// Checks the first 8 bytes of the file in the given Stream against the standard signature
/// for .png images. 
/// </summary>
/// <param name="file">The byte Stream pointing to data from the .png file</param>
/// <returns>True if the Stream file contains a valid .png image</returns>
Checks the first 8 bytes of the file in the given Stream against the standard signature
for .png images.
Checks the first 8 bytes of the file in the given Stream against the standard signature for . png images .
private static bool CheckSignature(ref Stream file)
        {
            byte[] signature = { 137, 80, 78, 71, 13, 10, 26, 10 };
            for (int i = 0; i < 8; ++i)
            {
                if (signature[i] != file.ReadByte()) return false;
            }
            return true;
        }
private static bool CheckSignature ( ref Stream file ) { byte [ ] signature = { 137 , 80 , 78 , 71 , 13 , 10 , 26 , 10 } ; for ( int i = 0 ; i < 8 ; ++ i ) { if ( signature [ i ] != file . ReadByte ( ) ) return false ; } return true ; }
Checks the first 8 bytes of the file in the given Stream against the standard signature
for .png images.
Checks the first 8 bytes of the file in the given Stream against the standard signature for . png images .
//8-byte .png signature
True if the Stream file contains a valid .png image
True if the Stream file contains a valid . png image
Stream
ref
file
The byte Stream pointing to data from the .png file
The byte Stream pointing to data from the . png file