Click here to Skip to main content
15,740,826 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Can anybody help me ?

How to draw curve line or arrow on webform in ?

Sergey Alexandrovich Kryukov 1-Nov-12 2:24am    
How a Webform is related to graphics? I'll tell you -- not related at all. Ever heard of separation of concerns?
mailanup1414 1-Nov-12 2:29am    
no. i want to display curved line dynamically on webform from coordinates (x1,y1) to (x2,y2).
Sergey Alexandrovich Kryukov 1-Nov-12 2:36am    
I tell you, it has nothing to do with WebForms. Form is not a rendered element; it is only needed to post data to server side from the client. I just answered on how to generate graphics, it should be completely clear now.

1 solution

There can be different approaches. You can generate Canvas drawing on the fly, using this HTML5 feature:[^].

The problem with that is not all Web browsers support HTML5 to the required degree. To check up, please see:[^],[^].

Alternatively, you can draw everything on the server side, using System.Drawing.Bitmap:[^],[^].

To draw on the bitmap, you should use the instance of the System.Drawing.Graphics obtained from the instance of Bitmap or an instance of any other type of System.Drawing.Image:[^],[^].

Then you can write a bitmap file on the server side and deliver it to the client through the <img> element with the value of src attribute containing the URI of your image. Alternatively, you can generate the whole HTTP response with appropriate content type to show just the graphics directly, without creating any files.

Share this answer
mailanup1414 1-Nov-12 2:43am    
thanks for the help. i will check
Sergey Alexandrovich Kryukov 1-Nov-12 2:59am    
You are very welcome.
Good luck, call again.
mailanup1414 1-Nov-12 3:12am    
sure :)

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