gpt4 book ai didi

C#数学图形库

转载 作者:太空狗 更新时间:2023-10-29 20:25:42 24 4
gpt4 key购买 nike

我想在 wpf 或 silverlight 中创建一个显示工作的小型数学求解器应用程序。类似于什么 Microsoft Math可以做。如何根据等式中的行数获得能够垂直拉伸(stretch)的括号等图形?

是否有任何库包含这些图形并显示 .net 的步骤?

最佳答案

根据@duffymo 的回答,您可以加载一个网络浏览器 WPF Webbrowser并注入(inject) MathJAX图书馆

供引用:

<Window x:Class="WpfApplication1.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Window1" Height="300" Width="300">
<Grid>
<WebBrowser x:Name="Browser" />
</Grid>

您可以使用以下代码与 JavaScript API 交互:

public partial class Window1 : Window
{
public Window1()
{
InitializeComponent();
Browser.LoadCompleted += BrowserOnLoadCompleted;
Browser.Navigate(new Uri("http://example.com"));
}

private void BrowserOnLoadCompleted(object sender, NavigationEventArgs navigationEventArgs)
{
var doc = (HTMLDocument)Browser.Document;
var head = doc.getElementsByTagName("head").Cast<HTMLHeadElement>().First();
var script = (IHTMLScriptElement)doc.createElement("script");
script.text = "alert('hi');";
head.appendChild((IHTMLDOMNode)script);
script.text = "alert('bye');";
}
}

关于C#数学图形库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4289232/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com