示例#1
0
        public static Image getImage(ParseTreeNode raiz)
        {
            String grafoDOT = ControlDOT.getDOT(raiz);

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

            return(imagen);
        }
示例#2
0
        private static Image generarImagen(String grafico)
        {
            //  String graph = DOT();



            WINGRAPHVIZLib.DOT dot = new WINGRAPHVIZLib.DOT();

            WINGRAPHVIZLib.BinaryImage img = dot.ToJPEG(grafico);
            byte[]       imageBytes        = Convert.FromBase64String(img.ToBase64String());
            MemoryStream ms = new MemoryStream(imageBytes, 0, imageBytes.Length);

            ms.Write(imageBytes, 0, imageBytes.Length);
            Image image = Image.FromStream(ms, true);

            img.Save(@"C:\\Users\PC\\Desktop\\thompson.jpg");
            return(image);
        }