Esempio n. 1
0
        public static void SaveExpressionToJpg(MathExpression expression, FontParams font, string jpgFileName)
        {
            if (Is64Bit)
            {
                var succes = FormulaDraw64.SaveExpressionToJpg(expression, font, jpgFileName, out ResultCodes rs);
                if (!succes)
                {
                    if (rs.ErrorCode == 1)
                    {
                        throw new MathExpressionExpectedSymbol(rs.ErrorPos, rs.ExpectedSymbols);
                    }

                    if (rs.ErrorCode == 2)
                    {
                        throw new MathExpressionInvalidSymbol(rs.ErrorPos);
                    }

                    if (rs.ErrorCode == 3)
                    {
                        throw new MathExpressionIncompletedExpressionString();
                    }

                    if (rs.ErrorCode == 4)
                    {
                        throw new MathExpressionExpectedDigitals(rs.ErrorPos);
                    }

                    if (rs.ErrorCode == 5)
                    {
                        throw new MathExpressionFileSavingError();
                    }
                }
            }
            else
            {
                var succes = FormulaDraw32.SaveExpressionToJpg(expression, font, jpgFileName, out ResultCodes rs);
                if (!succes)
                {
                    if (rs.ErrorCode == 1)
                    {
                        throw new MathExpressionExpectedSymbol(rs.ErrorPos, rs.ExpectedSymbols);
                    }

                    if (rs.ErrorCode == 2)
                    {
                        throw new MathExpressionInvalidSymbol(rs.ErrorPos);
                    }

                    if (rs.ErrorCode == 3)
                    {
                        throw new MathExpressionIncompletedExpressionString();
                    }

                    if (rs.ErrorCode == 4)
                    {
                        throw new MathExpressionExpectedDigitals(rs.ErrorPos);
                    }

                    if (rs.ErrorCode == 5)
                    {
                        throw new MathExpressionFileSavingError();
                    }
                }
            }
        }
Esempio n. 2
0
 internal static extern bool SaveExpressionToGif(MathExpression expression, FontParams font, [MarshalAs(UnmanagedType.BStr)] string pngfileName, out ResultCodes resultsCodes);