Come creare immagini via codice
<%@ Page ContentType = "image/gif"%>
<%@ Import Namespace = "System.Drawing" %>
<%@ Import Namespace = "System.Drawing.Imaging" %>
<html>
<Script Runat = "Server">
private void Page_Load(object sender, System.EventArgs e)
{
Bitmap objBitmap;
Graphics objGraphics;
objBitmap = new Bitmap(200, 200);
objGraphics = Graphics.FromImage(objBitmap);
objGraphics.DrawLine(new Pen(Color.Red), 0, 0, 200, 200);
objBitmap.Save(Response.OutputStream, ImageFormat.Gif);
objBitmap.Dispose();
objGraphics.Dispose();
}
</Script>
<body></body>
</html>
Scarica il Codice...
Stampa la pagina