예제 #1
0
 /// <summary>
 /// Read the PNG image from the bytes.
 /// </summary>
 /// <param name="bytes">The bytes of the PNG data to be read.</param>
 /// <param name="chunkVisitor">Optional: A visitor which is called whenever a chunk is read by the library.</param>
 /// <returns>The <see cref="Png"/> data from the bytes.</returns>
 public static Png Open(byte[] bytes, IChunkVisitor chunkVisitor = null)
 {
     using (var memoryStream = new MemoryStream(bytes))
     {
         return(PngOpener.Open(memoryStream, chunkVisitor));
     }
 }
예제 #2
0
 /// <summary>
 /// Read the PNG image from the stream.
 /// </summary>
 /// <param name="stream">The stream containing PNG data to be read.</param>
 /// <param name="chunkVisitor">Optional: A visitor which is called whenever a chunk is read by the library.</param>
 /// <returns>The <see cref="Png"/> data from the stream.</returns>
 public static Png Open(Stream stream, IChunkVisitor chunkVisitor = null)
 => PngOpener.Open(stream, chunkVisitor);