kleptos
Well-known member
I create an image with an aspx page and i want it to be transparent. I am pretty much just making a small rectangle image with some text on it. But the background needs to be transparent so all you see is the text, no background color. Any ideas or tutorials? Thanks!
Code:
<%@ Import Namespace="System" %>
<%@ Import Namespace="System.Drawing" %>
<%@ Import Namespace="System.Drawing.Drawing2D" %>
<%@ Import Namespace="System.Drawing.Imaging" %>
<script language="C#" runat="server">
private void Page_Load(object sender, System.EventArgs e)
{
Bitmap bmp = new Bitmap(175, 60);
Graphics g = Graphics.FromImage(bmp);
Font f = new Font("Verdana", 9);
SolidBrush b = new SolidBrush(Color.Black);
float x = 5;
float y = 5;
string line1 = "My String Of Text";
g.DrawString(line1, f, b, x, y);
Response.ContentType = "image/gif";
bmp.Save(Response.OutputStream, ImageFormat.Gif);
Response.End();
f.Dispose();
b.Dispose();
g.Dispose();
bmp.Dispose();
}
</script>