This is code from my dbimage.aspx page.
PHP Code:
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
namespace PKPromo.Web.Images
{
/// <summary>
/// Summary description for Image.
/// </summary>
public class Image : System.Web.UI.Page
{
private void Page_Load(object sender, System.EventArgs e)
{
if(Request["pid"] != "" && Request["pid"] != null)
{
Business.Images.Image img = new Business.Images.Image(new System.Guid(Request["pid"]));
Response.ContentType = "Image/jpeg";
Response.BinaryWrite(img.Raw);
Response.Flush();
Response.End();
}
else
{
Response.ContentType = "Image/jpeg";
Response.Flush();
Response.End();
}
}
#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
}
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
}
}
C# but you should be able to get the idea. Basicly you just turn the page into an image. <img src="dbimage.aspx?pid=imageid">
The important parts are the content type and the binary write.