[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 236
  • Last Modified:

Back up creation

In C++, I have drawn a line graph that indicates the travel pattern of a vehicle..(I did that in graphics mode)..

I would like to take a back up of this graph(the points in the graph) in a floppy.

Is there any way to save the contents of the graph which I have drawn?
0
aprajitha
Asked:
aprajitha
  • 2
1 Solution
 
graham_kCommented:
programatically, I presume, or would a screen dump be acceptable?

Do you want to save this from your program in order to be able to reload it? or do you want to give the floppy to friend who can then printthe graph?
0
 
wang_ghCommented:
If your graph is made of only lines,you can save their points into a array,and save the array into a file.
The document's Serialize function can help you to save and reload the lines.
You can get the points in OnMouseMove function.
0
 
aprajithaAuthor Commented:
I need more explaination on the same as to how should i proceed.

Also, Clarifiying with grahams comments, I should be able to reload the graph as well as to store the details in a floppy for others use
0
 
wang_ghCommented:
How do you draw lines?If you do it by mouse,you should do like this:

In your OnMouseMove() function,you can detect whether your mouse is down.If so,you must store the points into a array,which indicate a line.If not so,the user is not drawing line,but moving the mouse.That is to say,one array is for one line.

In your document's Serialize() function,you should call the array's Serialize() function.So the array can be stored into a file,and the file can be load to form arrays.You can find these infomation in MSDN.Just key "Serialize","CArray".

When the points are in a array.You can line 2 neighbour points,then a line is formed.
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now