.NET Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgramming.NET Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old May 29th, 2005, 05:48 AM
jul jul is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 14 jul User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 46 m 45 sec
Reputation Power: 0
drawing in Asp.Net

I want the image to be drawn on the my webpage(basically it is just a line which depends on some values). It seems that I am drawing something by this function, but it is just a small rectangle in the left upper corner of the page and nothing else is on the page. I think that the second problem has something to do with "stream.WriteTo(Response.OutputStream);" It outputs only the image and nothing else. The first problem I don't know what is wrong. Any suggestions, please!!!

The code:


//aspx.cs file

protected System.Web.UI.WebControls.Image tempImage;
const int panelW=100, panelH=30;

void build()
{
Panel1=new Panel1();
Panel1.Width=panelW;
Panel1.Height=panelH;
Panel1.BackColor=Color.SeaGreen;
tempImage=new System.Web.UI.WebControls.Image();
Panel1.Controls.Add(tempImage);
System.IO.MemoryStream stream = new System.IO.MemoryStream();

Bitmap image=new Bitmap((int) 10, (int)10);

Graphics g=Graphics.FromImage(image);
//g.Clear(Color.SeaGreen);
Brush brush=new SolidBrush(Color.Yellow);
g.FillRectangle(brush, 5,5,100,20);

image.Save(stream, System.Drawing.Imaging.ImageFormat.Gif);
stream.Position = 0;

stream.WriteTo(Response.OutputStream);
}

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgramming.NET Development > drawing in Asp.Net


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT