Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p><a href="http://msdn.microsoft.com/en-us/library/cc250427(PROT.10).aspx" rel="nofollow noreferrer">RectL Object</a>:</p> <pre><code>public static Rectangle ReadRectangle32(this BinaryReader reader) { // Left (4 bytes) int left = reader.ReadInt32(); // Top (4 bytes) int top = reader.ReadInt32(); // Right (4 bytes) int right = reader.ReadInt32(); // Bottom (4 bytes) int bottom = reader.ReadInt32(); return Rectangle.FromLTRB(left, top, right, bottom); } </code></pre> <p><a href="http://msdn.microsoft.com/en-us/library/cc250425(PROT.10).aspx" rel="nofollow noreferrer">PointS Object</a>:</p> <pre><code>public static Point ReadPoint16(this BinaryReader reader) { // x (2 bytes) int x = reader.ReadUInt16(); // y (2 bytes) int y = reader.ReadUInt16(); return new Point(x, y); } </code></pre> <p><a href="http://msdn.microsoft.com/en-us/library/cc230665(PROT.10).aspx" rel="nofollow noreferrer">EMR_POLYPOLYGON16 Record</a> (without type and size):</p> <pre><code>public static PolyPolygon ReadPolyPolygon16(this BinaryReader reader) { // Bounds (16 bytes) Rectangle bounds = reader.ReadRectangle32(); // NumberOfPolygons (4 bytes) int numberOfPolygons = reader.ReadInt32(); // Count (4 bytes) int count = reader.ReadInt32(); // PolygonPointCount (variable): // A NumberOfPolygons length array of 32-bit unsigned integers var polygonPointCount = new int[numberOfPolygons]; for (int i = 0; i &lt; polygonPointCount.Length; i++) { polygonPointCount[i] = reader.ReadInt32(); } // aPoints (variable): // A Count length array of WMF PointS objects var points = new Point[count]; for (int i = 0; i &lt; points.Length; i++) { points[i] = reader.ReadPoint16(); } return new PolyPolygon(bounds, numberOfPolygons, polygonPointCount, points); } </code></pre> <p>Usage:</p> <pre><code>byte[] buffer; using (var stream = new MemoryStream(buffer)) using (var reader = new BinaryReader(stream)) { var polypolygon = reader.ReadPolyPolygon16(); } </code></pre> <p><em>(Untested)</em></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload