Click here to Skip to main content
15,913,486 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Object reference not set to an instance of an object. Pin
Dinesh Mani17-Feb-10 1:20
Dinesh Mani17-Feb-10 1:20 
GeneralRe: Object reference not set to an instance of an object. Pin
BalasubramanianK17-Feb-10 1:23
BalasubramanianK17-Feb-10 1:23 
GeneralRe: Object reference not set to an instance of an object. Pin
Dinesh Mani17-Feb-10 1:35
Dinesh Mani17-Feb-10 1:35 
GeneralRe: Object reference not set to an instance of an object. Pin
BalasubramanianK17-Feb-10 2:39
BalasubramanianK17-Feb-10 2:39 
Questionpage refresh Pin
mylogics16-Feb-10 22:56
professionalmylogics16-Feb-10 22:56 
AnswerRe: page refresh Pin
Dinesh Mani16-Feb-10 23:10
Dinesh Mani16-Feb-10 23:10 
GeneralRe: page refresh Pin
mylogics16-Feb-10 23:12
professionalmylogics16-Feb-10 23:12 
QuestionGridView hyperlink Pin
Nikesh Jagtap16-Feb-10 22:16
Nikesh Jagtap16-Feb-10 22:16 
AnswerRe: GridView hyperlink Pin
Dinesh Mani16-Feb-10 23:19
Dinesh Mani16-Feb-10 23:19 
QuestionQuestion of my mind Pin
Anubhava Dimri16-Feb-10 22:08
Anubhava Dimri16-Feb-10 22:08 
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 

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.