Ejemplo n.º 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));
     }
 }
Ejemplo n.º 2
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="settings">Settings to apply when opening the PNG.</param>
 /// <returns>The <see cref="Png"/> data from the bytes.</returns>
 public static Png Open(byte[] bytes, PngOpenerSettings settings)
 {
     using (var memoryStream = new MemoryStream(bytes))
     {
         return(PngOpener.Open(memoryStream, settings));
     }
 }
Ejemplo n.º 3
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);
Ejemplo n.º 4
0
 /// <summary>
 /// Read the PNG image from the stream.
 /// </summary>
 /// <param name="stream">The stream containing PNG data to be read.</param>
 /// <param name="settings">Settings to apply when opening the PNG.</param>
 /// <returns>The <see cref="Png"/> data from the stream.</returns>
 public static Png Open(Stream stream, PngOpenerSettings settings)
 => PngOpener.Open(stream, settings);