Click here to Skip to main content
15,895,799 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi guys,

I want to draw a flow diagram which will shows the production and consumption values of the steel plants.

Plant1's output value will be the plant2's input value.

I want to connect to those plants by means of line which will be created dynamically.

And by clicking those lines it will forwarded to some other pages.

Plant can be an image/Button.

So, guys please reply as soon as possible.

Thanks in advance.
Posted
Comments
joshrduncan2012 23-Jul-13 9:16am    
Reply with what?

1 solution

1. Place a Image Control on web page.
<asp:image runat="server" id="imgData" xmlns:asp="#unknown" />   

2. Create "Bitmap" object on code side.
C#
Bitmap b =new Bitmap(width, height);

3. Create "Graphics" object with the help that "Bitmap".
C#
Graphics g = Graphics.FromImage(b);

4. Now Use "Graphics" objects methods for drawing boxes & lines ... etc.

C#
g.FillRectangle(new SolidBrush(Color.White), new Rectangle(0, 0, width, height));
g.DrawEllipse(Pens.LightGray, 0, 0, 50, 50);
g.DrawLine(Pens.LightGray, 0, 2, 50, 100);


5. Save the "Bitmap" to Disk on any path using save method of "Bitmap" object.

C#
b.Save(Server.MapPath("~\\UserUploadedDocuments\\ImageIcon.jpeg"));


6. Set "imgData" control ImageUrl property to saved image path.

C#
imgData.ImageUrl = "UserUploadedDocuments\\ImageIcon.jpeg";


This will render a dynamic image as per your need.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900