在线物理测试门户 [英] Online physics test portal
本文介绍了在线物理测试门户的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我创建了webform,其中有四个选项的问题从数据库填充,但是当包含数学表达式的选项然后如何从database.do创建选项时,我需要将图像格式的所有四个选项保存到数据库或文件系统或还有其他选择吗?
我的尝试:
我为简单文本创建了这个(不是用于数学表达式)
请帮助我
I have created webform where question with four options get populated from database,but when options containing mathematical expression then how to create the option from database.do i need to save all the four options in image format to database or file system or any other option is available?
What I have tried:
I have created this for simple text(not for mathematical expression)
please help me
推荐答案
这很复杂 - 可以显示数学公式,但它需要仔细使用字体才能在网站上正确使用 - 并且总会有人没有安装正确的字体!创建显示复杂公式的字体序列并非易事 - 你看看他们使用图像的Wolfram Alpha: https://www.wolframalpha.com/input/?i=integrate+sin+x+dx+from+x%3D0+to+pi&lk = 3 [ ^ ]
我建议您使用图像来存储它们 - 您可以存储它们作为Base64字符串并将其直接放入您的网页:
That's complicated - mathematical formulae can be displayed, but it needs careful work with fonts to get it right in a website - and there will always be someone who doesn't have the "right" font installed! It's not trivial to create the font sequences to display complex formulae - it you look at Wolfram Alpha they use images: https://www.wolframalpha.com/input/?i=integrate+sin+x+dx+from+x%3D0+to+pi&lk=3[^]
I'd suggest that you go with the image for these - you can store them as a Base64 string and put that directly into your webpage very easily:
byte[] rawData = File.ReadAllBytes(@"D:\Test Data\BigImage.jpg");
string base64 = Convert.ToBase64String(rawData);
Response.Write(string.Format("<img src=\"data:image/jpg;base64,{0}\">", base64));
这会从文件中加载图像,将其转换为Base64并将结果作为图像嵌入到网页中。
This loads an image from a file, converts it to Base64 and embeds the result as an image into the webpage.
这篇关于在线物理测试门户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文