How to draw lines in text file using c #
any one help me please
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Craig MercurPosted May 26, 2016, 10:42 AM
http://stackoverflow.com/questions/16212127/add-a-new-line-at-a-specific-position-in-a-text-file
But if you mean you want to draw a formatted line (that has color, thickness, etc.), to my knowledge, this is not supported in a regular text files. If this is the case, you have two options here:
1. Draw graphic lines inside a Rich Text file (instead of regular text) as shown below:
http://www.codeproject.com/Questions/656352/draw-line-in-rich-textbox
2. Load the text file as image (rasterize the text file) using a programming toolkit like leadtools. For details, see the following link:
https://www.leadtools.com/help/leadtools/v19/dh/co/leadtools.codecs~leadtools.codecs.codecstxtoptions.html
After this, you can draw lines over it using the Graphics.DrawLine() method. Keep in mind that the result file in this case is image file, not text. So you will need to save the result image using the System.Drawing.Image.Save() method as shown here:
https://msdn.microsoft.com/en-us/library/9t4syfhh%28v=vs.110%29.aspx
Farhan ShariffPosted Jun 2, 2016, 5:20 PM