| View previous topic :: View next topic |
| Author |
Message |
Mirage Member
Joined: 26 Oct 2005 Posts: 42
|
Posted: 27/10/05 09:19 Post subject: Add recto verso option to simplegraph |
|
|
Hello!
Please give me solution to add the option of recto and verso to simplegraph.
|
|
| Back to top |
|
 |
Kambiz Administrator

Joined: 07 Mar 2003 Posts: 1044 Location: Tehran, Iran
|
Posted: 28/10/05 11:13 Post subject: |
|
|
Seems you should use two instances of SimpleGraph.
Could you please explain more about your purpose?
_________________ Kambiz |
|
| Back to top |
|
 |
Mirage Member
Joined: 26 Oct 2005 Posts: 42
|
Posted: 31/10/05 08:49 Post subject: Add recto verso option to simplegraph |
|
|
Kambiz Hello!
Thank you for your answer!
I wants to add two SimpleGraph one to draw in recto and the other to draw in back I have a problem when I make the save. Please give me a method for save 2 SimpleGraph in only one file.
Thank you in advance!
|
|
| Back to top |
|
 |
Kambiz Administrator

Joined: 07 Mar 2003 Posts: 1044 Location: Tehran, Iran
|
Posted: 31/10/05 16:33 Post subject: |
|
|
Hi,
You have to use a stream to save graphs in to the stream, then save stream in the file.
Cheers
_________________ Kambiz |
|
| Back to top |
|
 |
Mirage Member
Joined: 26 Oct 2005 Posts: 42
|
Posted: 01/11/05 07:33 Post subject: Add recto verso option to simplegraph |
|
|
Kambiz Hello!
Thank you for your answer!
Please given me a method of use of Stream.
I do not know how not used.
Thank you in advance Mr. Kambiz.
|
|
| Back to top |
|
 |
Kambiz Administrator

Joined: 07 Mar 2003 Posts: 1044 Location: Tehran, Iran
|
Posted: 01/11/05 09:53 Post subject: |
|
|
Here are two procedures for saving/loading multiple graphs to/from a single file.
| Code: | procedure SaveMutipleGraphs(const FileName: String; Graphs: array of TSimpleGraph);
var
Stream: TFileStream;
I: Integer;
begin
Stream := TFileStream.Create(FileName, fmCreate or fmShareExclusive);
try
for I := Low(Graphs) to High(Graphs) do
Graphs[I].SaveToStream(Stream);
finally
Stream.Free;
end;
end;
procedure LoadMutipleGraphs(const FileName: String; Graphs: array of TSimpleGraph);
var
Stream: TFileStream;
I: Integer;
begin
Stream := TFileStream.Create(FileName, fmOpenRead or fmShareDenyWrite);
try
for I := Low(Graphs) to High(Graphs) do
Graphs[I].LoadFromStream(Stream);
finally
Stream.Free;
end;
end; |
Here is an example of usage:
| Code: | procedure TMainForm.btnSaveClick(Sender: TObject);
begin
SaveMutipleGraphs('C:\TEST.MG', [SimpleGraph1, SimpleGraph2]);
end;
procedure TMainForm.btnLoadClick(Sender: TObject);
begin
LoadMutipleGraphs('C:\TEST.MG', [SimpleGraph1, SimpleGraph2]);
end; |
Cheers
_________________ Kambiz |
|
| Back to top |
|
 |
Mirage Member
Joined: 26 Oct 2005 Posts: 42
|
Posted: 01/11/05 10:48 Post subject: Add recto verso option to simplegraph |
|
|
Thank you, thank you, thank you, thank you for you Kambiz!
You solved me a major problem.
Thank you, thank you, thank you, thank you for my Allah god!
|
|
| Back to top |
|
 |
lbc Member
Joined: 04 Feb 2004 Posts: 48 Location: Italy
|
Posted: 02/11/05 09:31 Post subject: |
|
|
great job
thank you Kambiz
|
|
| Back to top |
|
 |
|