Re: How to change the ResultFormatType of the MathKernel in a ASP.NET Web Application?
- To: mathgroup at smc.vnet.net
- Subject: [mg55464] Re: How to change the ResultFormatType of the MathKernel in a ASP.NET Web Application?
- From: "Hans Michel" <hmichel at sdc.cox.net>
- Date: Thu, 24 Mar 2005 03:42:06 -0500 (EST)
- References: <d1ecl3$esj$1@smc.vnet.net>
- Reply-to: "Hans Michel" <hmichel at sdc.cox.net>
- Sender: owner-wri-mathgroup at wolfram.com
Javier: Since it has been either Todd or I responding to your questions, I left this one unattended because I just thought it was a repost. I a way it is. But you are still having problems. You are using Visual Studio 2003 and you still write out full Object paths for lack of a better word. The sample I sent you in VB makes no reference to Global I declare a variable MathKernel1 as New Wolfram...MathKernel (Created the Object called MathKernel1) From then on I call MathKernel1 methods and set or get Properties. See post on 3/9/2005 There is no Global in the VB code. I think you are missing something fundamental. Copy all your code the machine generated stuff also. I'll review and get back to you. Hans "Javier Chicote" <goraperas at hotmail.com> wrote in message news:d1ecl3$esj$1 at smc.vnet.net... > Hi, > > I would like to change the ResultFormatType of my ASP.NET Web Application, > so that I could show the result of the Compute() method in a smart format. > (For example, TraditionalForm instead of OutputForm). I looked in the API > help and saw that the type of Result is a System.Drawing.Image. > > In the past I learnt how to show the image of the mathKernel.Graphics > result > in my application, using a WebForm with contentType="image/jpeg". The code > of the Page_Load was like this: > > private void Page_Load(object sender, System.EventArgs e) > { > image = mathKernel.Link.EvaluateToImage(input,200,200); > image.Save(Response.OutputStream, > System.Drawing.Imaging.ImageFormat.Jpeg); > } > > That worked perfectly, and now I would like to show the image of the > mathKernel.Result: > > private void Page_Load(object sender, System.EventArgs e) > { > mathKernel.ResultFormat = > Wolfram.NETLink.MathKernel.ResultFormatType.TraditionalForm; > mathKernel.Compute(input); > image = (System.Drawing.Image)Global.mathKernel.Result; > image.Save(Response.OutputStream, > System.Drawing.Imaging.ImageFormat.Jpeg); > } > > And this does NOT work, and I cannot see the image. How can I solve my > problem and show the result of the Compute() method using the > TraditionalForm of the ResultFormatType. > > Thanks, > > Javier Chicote > > >