Exemple #1
0
        private static void generarImagen(ParseTreeNode raiz)
        {
            String grafoDOT = ControlDOT.getDOT(raiz);

            WINGRAPHVIZLib.DOT         dot = new WINGRAPHVIZLib.DOT();
            WINGRAPHVIZLib.BinaryImage img = dot.ToPNG(grafoDOT);
            img.Save("AST.png");
        }
Exemple #2
0
        public static Image getImage(ParseTreeNode raiz)
        {
            String grafoDOT = ControlDOT.getDOT(raiz);

            WINGRAPHVIZLib.DOT         dot = new WINGRAPHVIZLib.DOT();
            WINGRAPHVIZLib.BinaryImage img = dot.ToPNG(grafoDOT);
            byte[]       imageBytes        = Convert.FromBase64String(img.ToBase64String());
            MemoryStream ms     = new MemoryStream(imageBytes, 0, imageBytes.Length);
            Image        imagen = Image.FromStream(ms, true);

            return(imagen);
        }