Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Other Discussions
  3. IT & Infrastructure
  4. Read from text file ..!!

Read from text file ..!!

Scheduled Pinned Locked Moved IT & Infrastructure
graphicstutorialquestioncareer
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    mr jets
    wrote on last edited by
    #1

    heloo guys..thanks alot u really doing agreat job ..any way i have finally created strings for each shape (lines,polygons,..) each string contains informations about the shape( x1,y1,x2,y2,R,G,B,pen width) ..Now how can i make my prog read from the text and draw the shapes ..as example the line string : public void AddSv(Line l , ref string str) { if(drawwhat==1)// as one means lines str +="1"+"\n"+l.First.X.ToString()+"\n"+ l.First.Y.ToString()+"\n"+ l.Second.X.ToString()+"\n"+ l.Second.Y.ToString()+"\n"+ l.Pen.Color.R.ToString()+"\n"+ l.Pen.Color.G.ToString()+"\n"+ l.Pen.Color.B.ToString()+"\n"+ l.Pen.Width.ToString()+"\n\n"; after i draw the line i click on save to send the informations to the text : private void button1_Click(object sender, System.EventArgs e) { //save System.IO.FileStream fs = new System.IO.FileStream("c:\\graphics.txt", System.IO.FileMode.OpenOrCreate, System.IO.FileAccess.Write, System.IO.FileShare.ReadWrite); StreamWriter streamWriter=new StreamWriter(fs); streamWriter.WriteLine(LineSv); streamWriter.Flush(); streamWriter.Close(); fs.Close(); } Regards:confused:

    N R 2 Replies Last reply
    0
    • M mr jets

      heloo guys..thanks alot u really doing agreat job ..any way i have finally created strings for each shape (lines,polygons,..) each string contains informations about the shape( x1,y1,x2,y2,R,G,B,pen width) ..Now how can i make my prog read from the text and draw the shapes ..as example the line string : public void AddSv(Line l , ref string str) { if(drawwhat==1)// as one means lines str +="1"+"\n"+l.First.X.ToString()+"\n"+ l.First.Y.ToString()+"\n"+ l.Second.X.ToString()+"\n"+ l.Second.Y.ToString()+"\n"+ l.Pen.Color.R.ToString()+"\n"+ l.Pen.Color.G.ToString()+"\n"+ l.Pen.Color.B.ToString()+"\n"+ l.Pen.Width.ToString()+"\n\n"; after i draw the line i click on save to send the informations to the text : private void button1_Click(object sender, System.EventArgs e) { //save System.IO.FileStream fs = new System.IO.FileStream("c:\\graphics.txt", System.IO.FileMode.OpenOrCreate, System.IO.FileAccess.Write, System.IO.FileShare.ReadWrite); StreamWriter streamWriter=new StreamWriter(fs); streamWriter.WriteLine(LineSv); streamWriter.Flush(); streamWriter.Close(); fs.Close(); } Regards:confused:

      N Offline
      N Offline
      Not Active
      wrote on last edited by
      #2

      Don't cross post:mad:


      only two letters away from being an asset

      1 Reply Last reply
      0
      • M mr jets

        heloo guys..thanks alot u really doing agreat job ..any way i have finally created strings for each shape (lines,polygons,..) each string contains informations about the shape( x1,y1,x2,y2,R,G,B,pen width) ..Now how can i make my prog read from the text and draw the shapes ..as example the line string : public void AddSv(Line l , ref string str) { if(drawwhat==1)// as one means lines str +="1"+"\n"+l.First.X.ToString()+"\n"+ l.First.Y.ToString()+"\n"+ l.Second.X.ToString()+"\n"+ l.Second.Y.ToString()+"\n"+ l.Pen.Color.R.ToString()+"\n"+ l.Pen.Color.G.ToString()+"\n"+ l.Pen.Color.B.ToString()+"\n"+ l.Pen.Width.ToString()+"\n\n"; after i draw the line i click on save to send the informations to the text : private void button1_Click(object sender, System.EventArgs e) { //save System.IO.FileStream fs = new System.IO.FileStream("c:\\graphics.txt", System.IO.FileMode.OpenOrCreate, System.IO.FileAccess.Write, System.IO.FileShare.ReadWrite); StreamWriter streamWriter=new StreamWriter(fs); streamWriter.WriteLine(LineSv); streamWriter.Flush(); streamWriter.Close(); fs.Close(); } Regards:confused:

        R Offline
        R Offline
        Rajesh R Subramanian
        wrote on last edited by
        #3

        Search MSDN for ExitWindowsEx()


        Nobody can give you wiser advice than yourself. - Cicero

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups