Example #1
0
        public void Begin(byte[] pixels, int pw, int ph)
        {
            if (_beginCalled)
            {
                throw new Exception("Call End() before calling Begin again");
            }

            _beginCalled = true;
            result.Clear();

            _handle = GCHandle.Alloc(pixels, GCHandleType.Pinned);
            fixed(STBTrueType.stbtt_pack_context *pcPtr = &pc)
            {
                STBTrueType.stbtt_PackBegin(pcPtr, (byte *)_handle.AddrOfPinnedObject().ToPointer(), pw, ph, pw, 1,
                                            null);
            }
        }