I would add a new webpage. In this webpage you have to query how many space is left or used by this user. Now you should create a new Bitmap, make the drawings on it and then write the new bitmap to the response stream (you also have to adjust the ContentType of the response). Here is some sample code (not tested!) that should create an 100x40 (24bit color depth) bitmap. The red part is the used and the green part is the free space. ShowImage.aspx.cs
public partial class ShowImage : System.Web.UI.Page
{
protected void Page\_Load(object sender, EventArgs e)
{
try
{
Response.Clear();
int nUsedSpaceInPercent = 70; // % <- here you should determine how many space is used
Bitmap bmp = new Bitmap(100, 40, PixelFormat.Format24bppRgb);
Graphics gfx = Graphics.FromImage(bmp);
gfx.FillRectangle(Brushes.Green, new Rectangle(0, 0, 100, 40));
gfx.FillRectangle(Brushes.Red, new Rectangle(0, 0, nUsedSpaceInPercent, 40));
gfx.DrawRectangle(Pens.Black, new Rectangle(0, 0, 100, 40));
Response.ContentType = "image/png";
Response.BufferOutput = true;
bmp.Save(Response.OutputStream, ImageFormat.Png);
}
catch (Exception ex)
{
// do some exception handling
}
}
}
ShowImage.aspx (this is the full file!)
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ShowImage.aspx.cs" Inherits="SomeNamespace.Display.ShowImage" %>
<%@ OutputCache Location="None" %>
Hope that helps.
Greetings Covean