Example #1
0
 private static Size DecodePng(BinaryReader binaryReader)
 {
     binaryReader.ReadBytes(8);
     int width = binaryReader.ReadLittleEndianInt32();
     int height = binaryReader.ReadLittleEndianInt32();
     return new Size(width, height);
 }
Example #2
0
 /// <summary>
 /// Gets the image dimensions of a Portable Network Graphics image from the given stream.
 /// </summary>
 /// <param name="binaryReader">The stream from which to read, which must already have advanced past the header.</param>
 /// <returns>The image dimensions for this PNG image.</returns>
 private static Size DecodePng(BinaryReader binaryReader)
 {
     binaryReader.ReadBytesExact(8);
     return new Size(binaryReader.ReadLittleEndianInt32(), binaryReader.ReadLittleEndianInt32());
 }