예제 #1
0
        public byte[] RenderDot(Cgraph cgraph, OutputFormat format)
        {
            _ = GraphvizApi.GvLayout(Handle, cgraph.Handle, "dot");
            _ = GraphvizApi.GvRenderData(Handle, cgraph.Handle, format.Value, out IntPtr result, out int length);

            byte[] image = new byte[length];
            Marshal.Copy(result, image, 0, length);

            _ = GraphvizApi.GvFreeLayout(Handle, cgraph.Handle);

            return(image);
        }
예제 #2
0
 public Graphviz()
 {
     Handle = new GraphvizHandle(GraphvizApi.GvContext());
 }
예제 #3
0
 protected override bool ReleaseHandle()
 {
     _ = GraphvizApi.GvFreeContext(handle);
     return(true);
 }