ok, adesso penso di aver capito cosa devi fare.
Devi farti un gestore della richiesta http, in gerco un "HttpHandler" (file con estensione "ashx", ovvero TastDX-Add Item->Generic Handler ) e mettere un tag "img" della pagina che chiama quel gestore.
Questo Handler, ritorna l'immagine disegnata al volo come avevamo fatto prima
Ti posto il codice:
http Handler nome "ImageHandler.ashx",
<%@ WebHandler Language="C#" Class="ImageHandler" %>
using System;
using System.Web;
using System.Drawing;
public class ImageHandler : IHttpHandler {
public void ProcessRequest (HttpContext context)
{
Bitmap bmp = new Bitmap(100, 100);
Graphics graph = Graphics.FromImage(bmp);
//--- rettangolo
graph.FillRectangle(new SolidBrush(Color.White), 10, 10, 70, 30);
//--- ci scrivo dentro
graph.DrawString(context.Request.QueryString["prezzo"],
new Font("Tahoma", 12f),
new SolidBrush(Color.Red), 15, 15);
context.Response.ContentType = "image/jpeg";
bmp.Save(context.Response.OutputStream,
System.Drawing.Imaging.ImageFormat.Jpeg);
}
public bool IsReusable {
get {
return false;
}
}
}
pagina asp.net :
<form id="form1" runat="server">
<img src="ImageHandler.ashx?prezzo=10" />
<img src="ImageHandler.ashx?prezzo=20" />
<img src="ImageHandler.ashx?prezzo=30" />
</form>
come vedi la chiamata passa il parametro "prezzo" (ImageHandler.ashx?prezzo=xxx) che poi dentro all'handler vai ad usare come discriminante di cosa disegnare (context.Request.QueryString["prezzo"]) per disegnare quello che ti serve.
Questo è un esempio ovviamente, tu rendilo adatto alla tua situazione...
ciao.
Matteo Raumer
[MCAD .net]
http://blogs.dotnethell.it/freeteo