|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
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); } |
![]() |
| Viewing: Dev Articles Community Forums > Programming > .NET Development > drawing in Asp.Net |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|