Add recto verso option to simplegraph
Select messages from
# through # FAQ
[/[Print]\]

DELPHI AREA -> DELPHI AREA's Products

#1: Add recto verso option to simplegraph Author: Mirage PostPosted: 27/10/05 09:19
    —
Hello!

Please give me solution to add the option of recto and verso to simplegraph.
Crying or Very sad

#2:  Author: KambizLocation: Tehran, Iran PostPosted: 28/10/05 11:13
    —
Seems you should use two instances of SimpleGraph.

Could you please explain more about your purpose?

#3: Add recto verso option to simplegraph Author: Mirage PostPosted: 31/10/05 08:49
    —
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! Wink

#4:  Author: KambizLocation: Tehran, Iran PostPosted: 31/10/05 16:33
    —
Hi,

You have to use a stream to save graphs in to the stream, then save stream in the file.

Cheers

#5: Add recto verso option to simplegraph Author: Mirage PostPosted: 01/11/05 07:33
    —
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. Rolling Eyes

#6:  Author: KambizLocation: Tehran, Iran PostPosted: 01/11/05 09:53
    —
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

#7: Add recto verso option to simplegraph Author: Mirage PostPosted: 01/11/05 10:48
    —
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!

#8:  Author: lbcLocation: Italy PostPosted: 02/11/05 09:31
    —
great job
thank you Kambiz



DELPHI AREA -> DELPHI AREA's Products


output generated using printer-friendly topic mod. All times are GMT

Page 1 of 1

Powered by phpBB © 2001, 2005 phpBB Group