Stan -
Here's an example. The one thing I think you'll need to play with is
the positioning of the point (last parameter of the DrawString
function). If you saved this as Image.aspx, you could display it on
another page with <img src="image.aspx?Legend=Sample">.
<%@ Page Language="VB" ContentType="image/jpeg" %>
<%@ Import Namespace="System.Drawing" %>
<%@ Import Namespace="System.Drawing.Text" %>
<%@ Import Namespace="System.Drawing.Imaging" %>
<%@ Import Namespace="System.Drawing.Drawing2D" %>
<%
Response.Clear( )
Dim Legend as String
If Request.QueryString("Legend") = Nothing Then
Legend = ""
Else
Legend = Request.QueryString("Legend")
End If
Dim bmp as Bitmap = Image.FromFile("Input.bmp")
Dim g as Graphics = Graphics.FromImage(bmp)
g.RotateTransform(30);
g.DrawString(Legend, _
New Font("Arial", 12, FontStyle.italic), _
SystemBrushes.WindowText, New PointF(100,100))
g.ResetTransform();
bmp.Save(Response.OutputStream, ImageFormat.Jpeg)
g.Dispose( )
bmp.Dispose( )
Response.End( )
%>
References:
http://www.wwwcoder.com/main/Default...=407&site=1727 http://www.codeproject.com/aspnet/as...b_graphics.asp http://www.syncfusion.com/FAQ/WinForms/FAQ_c3c.asp http://www.bobpowell.net/faqmain.htm
- Jon
http://weblogs.asp.net/jgalloway