Exemple #1
0
        public BitmapImage ParseLaTex()
        {
            try
            {
                var formula = s_FormulaParser.Value.Parse(m_LaTex);
                //var renderer = formula.GetRenderer(TexStyle.Display, m_scale);
                var renderer     = formula.GetRenderer(TexStyle.Display, m_scale, systemTextFontName: "Arial"); // for VS2017 version
                var bitmapsource = renderer.RenderToBitmap(0, 0);

                return(bitmapsource.ToPNGImage());
            }
            catch (Exception ex)
            {
                var err = new ErrorMessageDrawingVisual(ex.Message);
                return(DrawingVisualUtil.ToPNGImage(err));
            }
        }
 public BitmapImage ToBitmapImage()
 {
     return(DrawingVisualUtil.ToPNGImage(this));
 }