[Transfer] Generate a GIF picture in the web page

xiaoxiao2021-03-06  76

Everyone knows that the K-line map of the stock website is a dynamically generated timing refresh PHP has a dynamically generated image function that uses ASP.NET to generate a picture in the web page? The example I want to make is dynamically generating a picture showing the current time Namespace WMJ {Using System; Using System.drawing; Using System.Web.ui;

public class MyTempImage: Page {public string CreateImage () {string str = DateTime.Now.ToString (); Bitmap image = new Bitmap (200,30); Graphics g = Graphics.FromImage (image); string thefullname = Server.MapPath ("/") "/nowtime.gif";g.clear(Color.White );g.drawstring(Str, New Font (" Courier New ", 10), New Solidbrush (Color.Red), 20, 5); // Graphics class There are still many drawings to draw straight lines, curves, circles, etc. Image.Save (TheFullname, System.drawing.Imaging.ImageFormat.gif); Return "/nowtime.gif";}} }/ // <% @ page language = "c #"%> <% @ import namespace = "wmj"%>