Click here to Skip to main content
15,890,282 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Question of my mind Pin
mylogics16-Feb-10 23:10
professionalmylogics16-Feb-10 23:10 
GeneralRe: Question of my mind Pin
Anubhava Dimri17-Feb-10 0:12
Anubhava Dimri17-Feb-10 0:12 
GeneralRe: Question of my mind Pin
mylogics17-Feb-10 0:18
professionalmylogics17-Feb-10 0:18 
GeneralRe: Question of my mind Pin
Anubhava Dimri17-Feb-10 17:21
Anubhava Dimri17-Feb-10 17:21 
Questionloginview Pin
arkiboys16-Feb-10 20:35
arkiboys16-Feb-10 20:35 
AnswerRe: loginview Pin
arkiboys17-Feb-10 3:37
arkiboys17-Feb-10 3:37 
QuestionCreating Image on basis of space used Pin
Bajrang Singh16-Feb-10 20:04
Bajrang Singh16-Feb-10 20:04 
AnswerRe: Creating Image on basis of space used Pin
Covean16-Feb-10 23:50
Covean16-Feb-10 23:50 
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

QuestionSQL Query Pin
abglorie16-Feb-10 19:35
abglorie16-Feb-10 19:35 
AnswerRe: SQL Query Pin
Brij16-Feb-10 19:51
mentorBrij16-Feb-10 19:51 
AnswerRe: SQL Query Pin
keyur satyadev16-Feb-10 19:58
keyur satyadev16-Feb-10 19:58 
AnswerRe: SQL Query Pin
Not Active17-Feb-10 0:28
mentorNot Active17-Feb-10 0:28 
QuestionHow to get Confirmation message when i sent pdf as mail in asp.net Pin
naren.venkata@yahoo.com16-Feb-10 19:06
naren.venkata@yahoo.com16-Feb-10 19:06 
AnswerRe: How to get Confirmation message when i sent pdf as mail in asp.net Pin
keyur satyadev16-Feb-10 19:45
keyur satyadev16-Feb-10 19:45 
GeneralRe: How to get Confirmation message when i sent pdf as mail in asp.net Pin
naren.venkata@yahoo.com17-Feb-10 0:43
naren.venkata@yahoo.com17-Feb-10 0:43 
QuestionHow to select Directory Pin
sjs4u16-Feb-10 18:49
sjs4u16-Feb-10 18:49 
AnswerRe: How to select Directory Pin
Brij16-Feb-10 19:06
mentorBrij16-Feb-10 19:06 
GeneralRe: How to select Directory Pin
mylogics16-Feb-10 23:21
professionalmylogics16-Feb-10 23:21 
GeneralRe: How to select Directory Pin
Brij17-Feb-10 0:35
mentorBrij17-Feb-10 0:35 
QuestionCOM Problem Pin
JC.KaNNaN16-Feb-10 18:44
JC.KaNNaN16-Feb-10 18:44 
AnswerRe: COM Problem Pin
Brij16-Feb-10 19:16
mentorBrij16-Feb-10 19:16 
GeneralRe: COM Problem Pin
JC.KaNNaN16-Feb-10 20:38
JC.KaNNaN16-Feb-10 20:38 
QuestionHow to move columns of Gridview at Runtime ? Pin
H_i_M16-Feb-10 18:37
H_i_M16-Feb-10 18:37 
AnswerRe: How to move columns of Gridview at Runtime ? Pin
Brij16-Feb-10 19:12
mentorBrij16-Feb-10 19:12 
AnswerRe: How to move columns of Gridview at Runtime ? Pin
gajendra_kshatriya16-Feb-10 21:19
gajendra_kshatriya16-Feb-10 21:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.