示例#1
0
        public Image ConvertToGif(EquationInput ei)
        {
            m_ei = ei;

            string fileName = Path.GetTempPath() + Guid.NewGuid().ToString() + ".tmp";

            m_eo = new EquationOutputFileGIF(fileName);

            if (m_ei.Get())
            {
                // Console.WriteLine("Get MTEF");
                if (m_ei.GetMTEF())
                {
                    if (ConvertToOutput())
                    {
                        Image img = Bitmap.FromFile(fileName);
                        //File.Delete(fileName);

                        return(img);
                    }
                }
            }

            return(null);
        }
示例#2
0
        virtual protected bool Convert()
        {
            bool bReturn = false;

            Console.WriteLine("Converting {0} to {1}", m_ei.ToString(), m_eo.ToString());

            Console.WriteLine("Get equation: {0}", m_ei.strFileName);
            if (m_ei.Get())
            {
                Console.WriteLine("Get MTEF");
                if (m_ei.GetMTEF())
                {
                    Console.WriteLine("Convert Equation");
                    if (ConvertToOutput())
                    {
                        Console.WriteLine("Write equation: {0}", m_eo.strFileName);
                        if (m_eo.Put())
                        {
                            bReturn = true;
                        }
                    }
                }
            }

            Console.WriteLine("Convert success: {0}\r\n", bReturn.ToString());
            return(bReturn);
        }
示例#3
0
        public string ConvertToText(EquationInput ei)
        {
            m_ei = ei;
            m_eo = new EquationOutputFileText("", "Texvc.tdl");

            if (m_ei.Get())
            {
                // Console.WriteLine("Get MTEF");
                if (m_ei.GetMTEF())
                {
                    if (ConvertToOutput())
                    {
                        return(m_eo.strEquation);
                    }
                }
            }

            return("");
        }