MathGroup Archive 2004

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: How to give back to an image using "Net/Link" and "asp.net"?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg46866] Re: How to give back to an image using "Net/Link" and "asp.net"?
  • From: albert_666 at hotmail.com (Roger)
  • Date: Fri, 12 Mar 2004 02:02:50 -0500 (EST)
  • References: <c2lph7$9c6$1@smc.vnet.net> <c2p9bo$dm3$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Hello Michel
Thank you very much by your answer.

It already modifies the lines that you indicated to me, but still
profit not to show the image in WebForm1.aspx

Next I show the code to you of the archives: WebForm1.asp,
WebForm2.aspx and WebForm2.aspx.vb to see if you can please find some
error or something that I need.

----------------------------------------------------------------------------
WebForm1.aspx:
<%@ Page Language="vb" AutoEventWireup="false"
Codebehind="WebForm1.aspx.vb" Inherits="WebCalculo.WebForm1"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
	<HEAD>
		<title>WebForm1</title>
	    <meta name="GENERATOR" content="Microsoft Visual Studio .NET
7.1">
		<meta name="CODE_LANGUAGE" content="Visual Basic .NET 7.1">
		<meta name=vs_defaultClientScript content="JavaScript">
		<meta name=vs_targetSchema
content="http://schemas.microsoft.com/intellisense/ie5";>

	</HEAD>
	<body>
		<form id="Form1" method="post" runat="server">
			<IMG style="Z-INDEX: 101; LEFT: 24px; WIDTH: 192px; POSITION:
absolute; TOP: 24px; HEIGHT: 168px"
				height="168" alt="" src="WebForm2.aspx" width="192">
		</form>
	</body>
</HTML>

---------------------------------------------------------------------------
WebForm2.aspx:

<%@ Page Language="vb" AutoEventWireup="false"
Codebehind="WebForm2.aspx.vb" Inherits="WebCalculo.WebForm2"%>

----------------------------------------------------------------------------
WebForm2.aspx.vb:

Imports System.Drawing
Imports System.Drawing.Imaging
Imports Wolfram.NETLink

Public Class WebForm2
    Inherits System.Web.UI.Page

    Private mathKernel As New Wolfram.NETLink.MathKernel

    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load

        If (mathKernel.IsComputing()) Then
            mathKernel.Abort()
        Else
            mathKernel.CaptureGraphics = True
            mathKernel.Compute("Plot[x,{x,0,1}]")
            mathKernel.Graphics(0).Save(Response.OutputStream,
System.Drawing.Imaging.ImageFormat.Jpeg)
        End If
    End Sub
End Class

Thanks.

"Hans Michel" <hansjm at bellsouth.net> wrote in message news:<c2p9bo$dm3$1 at smc.vnet.net>...
> Hi.
> 
> WebForm2.aspx
> HTML page should contain only the page directive
> 
> <%@ Page ... Should also have
> 
> EnableSessionState = False enableViewStae=False aspCompat="True"
> 
> No html code at all.
> 
> in the code behind
> 
> I think your missing this
> 
> Do not use Response.Write and don't ne to tell the content type.
> just use
> mathkernel.Graphics(0).Save(Response.OutputStream,
> System.Drawing.Imaging.ImageFormat.Jpeg)
> 
> Hans


  • Prev by Date: Excessive Mathematica memory use, revisited.
  • Next by Date: Mathematica programmer needed
  • Previous by thread: Re: How to give back to an image using "Net/Link" and "asp.net"?
  • Next by thread: Re: How to give back to an image using "Net/Link" and "asp.net"?