本文介绍了如何将公式字符串转换为图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将公式字符串(例如a/b + c * sqrt d)转换为图像
就像以下网页一样.

[ ^ ]

有人提供例子或某物吗?谢谢


(这是一个清晰的描述吗?为什么没有答复???)

I want to convert a string of formula (such as a/b+c* sqrt d)to an image
Like what the following webpage does.

http://www.wolframalpha.com/input/?i=3%2F2%2B%285*%286%2F%284%2F%283%2F%282%2F1%29%29%29%29%29%2F4[^]

somebody provide an example or sth? thanks


(Is this a clear description?why no replys???)

推荐答案

    23
a = --
    10


首先需要两个行",每行必须足够高以包含所选字体中的字符.其次,一条线"高到足以包含分隔符.表达式"a ="的开头应位于分隔线的中心.实际的计算将基于您希望显示的图像的大小以及用于字符的字体的大小,因此,假设字体高10像素,宽8像素,我们将得到以下内容:


requires first, two ''lines'', each of which needs to be high enough to contain characters in the selected font. Secondly a ''line'' high enough to contain a separator. The start of the expression "a = " should be positioned centred on the dividing line. The actual calculations would be based on the size of the image you wish to display and the size of the font being used for the characters, so assuming a font 10 px high by 8 px wide we would have something like:

moveto(32, 0) // position X, Y
write("23")
moveto(0, 6)
write("a = ")
moveto(32, 12)
lineto(48, 12)
moveto(32, 14)
write("10")


这篇关于如何将公式字符串转换为图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-23 08:48