Mega Code Archive

 
Categories / ASP.Net Tutorial / Page Lifecycle
 

Gif image

<%@ Page language="c#" %> <%@ Import Namespace="System.Drawing" %> <%@ Import Namespace="System.Drawing.Imaging" %> <%@ Import Namespace="System.Drawing.Drawing2D" %> <%@ Import Namespace="System.Drawing.Text" %> <script runat="server">     private void Page_Load(object sender, System.EventArgs e)     {       Bitmap InputBitmap = new Bitmap(Server.MapPath("logo.gif"));              int newWidth = 100;       int newHeight = 100;       Bitmap OutputBitmap = new Bitmap(InputBitmap, newWidth, newHeight);       Response.Clear();       Response.ContentType="image/Gif";       OutputBitmap.Save(Response.OutputStream, ImageFormat.Gif);       OutputBitmap.Dispose();       InputBitmap.Dispose();     } </script>