Hi Shanky,
Drawing lines are possible in C#, however if you really need real time you might be using HTML5 Cavas with the help of JavaScript. Read more about HTML5 Canvas here
http://www.dotnetfunda.com/articles/show/1940/introduction-to-canvas-in-html5.
To draw a line in C#, you can follow below approach
Bitmap image = new Bitmap(width, count);
Graphics g = null;
try
{
g = Graphics.FromImage(image);
g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;
Font f = new Font("Arial", textSize, FontStyle.Regular);
SolidBrush b = new SolidBrush(Color.SkyBlue);
g.FillRectangle(b, 0, 0, 400, count);
g.DrawString(textToWrite, f, Brushes.Blue, 2, 5);
g.DrawLine(new Pen(Color.Blue, 1), new Point(5, 25), new Point(100, 0));
g.DrawLine(new Pen(Color.White, 1), new Point(60, 10), new Point(120, 28));
f.Dispose();
image.Save(context.Response.OutputStream, System.Drawing.Imaging.ImageFormat.Jpeg);
}
catch (Exception ee)
{
context.Response.Write(ee.Message.ToString());
}
finally
{
image.Dispose();
g.Dispose();
}
Notice DrawLine in the above code snippet.
Hope this helps.
Thanks
Regards,
Sheo Narayan
http://www.dotnetfunda.com
Shanky11, if this helps please login to Mark As Answer. | Alert Moderator