| | |
connecting circles dynamically
Please support our ASP.NET advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Nov 2007
Posts: 24
Reputation:
Solved Threads: 0
Hi all,
Im having some problem in my application .i want to take input of tasks and preceding activities. What I want to do is to draw circles for the given number of tasks and connect them according to their preceding activities.e.g, if user input 1,2 for preceding activity 3 then it connects tasks 1 and task2. I have drawn the circles but have problem in connecting them. here’s my code..
protected void Button1_Click(object sender, EventArgs e)
{
//values of textboxes stored in array
ArrayList tasks = new ArrayList();
tasks.Add(Task1TB.Text);
tasks.Add(Task2TB.Text);
tasks.Add(Task3TB.Text);
//Preceding activities stored in array
ArrayList pa = new ArrayList();
pa.Add(PA1TB.Text);
pa.Add(PA2TB.Text);
pa.Add(PA3TB.Text);
Bitmap Bmp1;
Graphics Gfx;
Bmp1 = new Bitmap(600, 500);
Font Fnt;
int intFontSize = 16;
Fnt = new System.Drawing.Font("Arial", intFontSize, FontStyle.Bold);
int xpos = 50;
int ypos = 50;
int xpos2 = 50 + 10 * 2;
int ypos2 = 50 + 10 % 2;
//draw circles for each task
for (int i = 1; i <= tasks.Count; i++)
{
Gfx = Graphics.FromImage(Bmp1);
Gfx.DrawString("Task" + i, Fnt, Brushes.White, xpos - 10 * 2, ypos - 10 * 2);
Gfx.DrawEllipse(Pens.DarkOrange, xpos, ypos, 75, 75);
xpos = xpos + 80;
ypos = ypos + 90 * 2;
//checks preceding activity and draws line accordingly
//e.g. if task2 depands on task1 a line coonects from tasks2 to task1.
//if task3 depends on task2 and task1 then task3 connects to task2 and task1
if (pa[2] == "1")
{
Gfx.DrawLine(Pens.White, xpos, ypos, xpos2, ypos2);
}
}
Bmp1.Save(Response.OutputStream, ImageFormat.Gif);
}
Im having some problem in my application .i want to take input of tasks and preceding activities. What I want to do is to draw circles for the given number of tasks and connect them according to their preceding activities.e.g, if user input 1,2 for preceding activity 3 then it connects tasks 1 and task2. I have drawn the circles but have problem in connecting them. here’s my code..
protected void Button1_Click(object sender, EventArgs e)
{
//values of textboxes stored in array
ArrayList tasks = new ArrayList();
tasks.Add(Task1TB.Text);
tasks.Add(Task2TB.Text);
tasks.Add(Task3TB.Text);
//Preceding activities stored in array
ArrayList pa = new ArrayList();
pa.Add(PA1TB.Text);
pa.Add(PA2TB.Text);
pa.Add(PA3TB.Text);
Bitmap Bmp1;
Graphics Gfx;
Bmp1 = new Bitmap(600, 500);
Font Fnt;
int intFontSize = 16;
Fnt = new System.Drawing.Font("Arial", intFontSize, FontStyle.Bold);
int xpos = 50;
int ypos = 50;
int xpos2 = 50 + 10 * 2;
int ypos2 = 50 + 10 % 2;
//draw circles for each task
for (int i = 1; i <= tasks.Count; i++)
{
Gfx = Graphics.FromImage(Bmp1);
Gfx.DrawString("Task" + i, Fnt, Brushes.White, xpos - 10 * 2, ypos - 10 * 2);
Gfx.DrawEllipse(Pens.DarkOrange, xpos, ypos, 75, 75);
xpos = xpos + 80;
ypos = ypos + 90 * 2;
//checks preceding activity and draws line accordingly
//e.g. if task2 depands on task1 a line coonects from tasks2 to task1.
//if task3 depends on task2 and task1 then task3 connects to task2 and task1
if (pa[2] == "1")
{
Gfx.DrawLine(Pens.White, xpos, ypos, xpos2, ypos2);
}
}
Bmp1.Save(Response.OutputStream, ImageFormat.Gif);
}
![]() |
Similar Threads
- 56k connecting at 12k-18k????? (Networking Hardware Configuration)
- My Pc keeps restarting when connecting to the internet (Troubleshooting Dead Machines)
- can only open my documents after connecting to internet (Web Browsers)
- connecting to internet mac (OS X)
- Connecting via Winmatrix to Access (ASP.NET)
- Connecting Peak wireless router to Motorola SB4100 cable modem (Networking Hardware Configuration)
- Problem connecting to the internet (Web Browsers)
Other Threads in the ASP.NET Forum
- Previous Thread: how can i createa slide show in aspx page
- Next Thread: How can I work server side without refreshing web pages
Views: 672 | Replies: 0
| Thread Tools | Search this Thread |
Tag cloud for ASP.NET
.net 2.0 activexcontrol advice ajax alltypeofvideos anathor application asp asp.net bc30451 bottomasp.net box browser button c# checkbox commonfunctions complex connection dataaccesslayer database datagridview datagridviewcheckbox datalist development dgv dropdownlist dynamically edit editing expose feedback fileuploader fill flash form formatdecimal formview google gridview gudi iframe iis javascript list listbox login microsoft migration mono mouse mssql news numerical opera panelmasterpagebuttoncontrols parent problem project radio redirect registration relationaldatabases reportemail richtextbox rows save schoolproject search security select services session silverlight smartcard smoobjects software sql sql-server sqlserver2005 suse textbox theft tracking unauthorized validation vb.net video videos view vista visualstudio web webapplications webdevelopemnt webprogramming webservice xsl youareanotmemberofthedebuggerusers





