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.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Craig Mercur2 reputationPosted May 26, 2016, 6:42 AM EDT
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 ShariffRank #2,004 · 725 reputationPosted Jun 2, 2016, 1:20 PM EDT