Re: NET/Link graphics
- To: mathgroup at smc.vnet.net
- Subject: [mg47473] Re: NET/Link graphics
- From: "Hans Michel" <hansjm at bellsouth.net>
- Date: Tue, 13 Apr 2004 06:26:26 -0400 (EDT)
- References: <c5dif4$nu0$1@smc.vnet.net>
- Reply-to: "Hans Michel" <hansjm at bellsouth.net>
- Sender: owner-wri-mathgroup at wolfram.com
Matt: Try this instead of using a MathPictureBox use a regular PictureBox and a Mathlink .NET IKernelLink EvaluateToImage is essentially an image so save it to as a new Bitmap and render that image in a pictur box. private Bitmap MyImage ; MyImage = new Bitmap(ml.EvaluateToImage("Plot[x,{x,0,1}]", 400, 400)); pictureBox1.Image = (Image) MyImage ; Hans. "Brown, Matt" <mbrown at phys.ksu.edu> wrote in message news:c5dif4$nu0$1 at smc.vnet.net... > When I use the MathPictureBox from within Mathematica it works just fine. But when I try to use it from a dotNET program, and set the MathCommand string I always get a System.Format error, saying that the string is the wrong format. MathPictureBox uses the EvaluateToGraphics method. When I try to use this in my code I get the same error, even when I paste the API example directly into my code. > > ie: > ml.EvaluateToImage("Plot[x,{x,0,1}]", 400, 400); > > this is driving me nuts. Any ideas? >