%@ Page Language="c#"%>
<%@ Import Namespace="System.Drawing.Imaging" %>
<%@ Import Namespace="System.Drawing" %>
<%@ Import Namespace="System.Drawing.Drawing2D" %>
<script runat="server">
private void Page_Load(object sender, System.EventArgs e)
{
Bitmap bmp= new Bitmap(Server.MapPath(Request.QueryString["i"]));
Graphics g=Graphics.FromImage(bmp);
g.SmoothingMode = SmoothingMode.AntiAlias ;
g.DrawString(Request.QueryString["t"],
new Font("verdana",12),SystemBrushes.WindowText, 1, 1);
Response.ContentType="image/jpeg";
bmp.Save(Response.OutputStream, bmp.RawFormat) ;
}
</script>
Friday, 17 February 2012
Embed text in Image using ASP.NET
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment