internal static IntPtr GlyphsToIntPtr (Glyph[] glyphs) { int size = Marshal.SizeOf (glyphs[0]); IntPtr dest = Marshal.AllocHGlobal (size * glyphs.Length); int pos = dest.ToInt32 (); for (int i = 0; i < glyphs.Length; i++, pos += size) Marshal.StructureToPtr (glyphs[i], (IntPtr) pos, false); return dest; }
public void GlyphPath(Matrix matrix, Glyph[] glyphs) { IntPtr ptr; ptr = FromGlyphToUnManagedMemory(glyphs); CairoAPI.cairo_glyph_path(state, ptr, glyphs.Length); Marshal.FreeHGlobal(ptr); }