Skip to content

Commit f7549ae

Browse files
committed
Update README.md
1 parent 87736e3 commit f7549ae

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

README.md

+17
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
11
# PNGNormalizer
22

33
Provides PNG normalization for files that have been crushed, especially PNGs optimized for iOS with Apple's version of pngcrush.
4+
5+
## How To Use
6+
This example shows how to read a crushed PNG, named *[email protected]*, and save a normalized version as *[email protected]*.
7+
8+
```C#
9+
// Get crushed PNG file as a byte array
10+
byte[] sourcePngData = System.IO.File.ReadAllBytes("[email protected]");
11+
12+
// Parse the crushed data
13+
var png = new PngFile(sourcePngData);
14+
15+
// Get the normalized PNG data
16+
byte[] normalizedPngData = png.Data;
17+
18+
// Save the normalized file
19+
System.IO.File.WriteAllBytes("[email protected]", normalizedPngData);
20+
```

0 commit comments

Comments
 (0)