Page 1 of 1

about print graphics

PostPosted: January 5th, 2005, 8:09 am
by dennis
how to print graphics
like lines, rectangle and all that
thanks

PostPosted: January 5th, 2005, 4:36 pm
by Stefan
From the Delphi help:

This example uses a button, a Page Control, and a Print dialog box on a form. When the user clicks the button, the print dialog is displayed. The user can select any subset of the pages in the page control for printing. The selected pages are then printed.
To run this example successfully, you must add the Printers unit to the uses clause of your unit.


Code: Select all
procedure TForm1.Button1Click(Sender:TObject);

var
  I, Start, Stop: Integer;
begin
  PrintDialog1.Options := [poPageNums, poSelection];
  PrintDialog1.FromPage := 1;
  PrintDialog1.MinPage := 1;
  PrintDialog1.ToPage := PageControl1.PageCount;
  PrintDialog1.MaxPage := PageControl1.PageCount;
  if PrintDialog1.Execute then
  begin
    { determine the range the user wants to print }
    with PrintDialog1 do
    begin
      if PrintRange = prAllPages then

        begin
        Start := MinPage - 1;
        Stop := MaxPage - 1;
      end
      else if PrintRange = prSelection then
      begin
        Start := PageControl1.ActivePage.PageIndex;
        Stop := Start;
        end
      else  { PrintRange = prPageNums }
      begin
        Start := FromPage - 1;
        Stop := ToPage - 1;
      end;
    end;
    { now, print the pages }

    with Printer do
    begin
      BeginDoc;
      for I := Start to Stop do
      begin
        PageControl1.Pages[I].PaintTo(Handle, 10, 10);
        if I <> Stop then
          NewPage;
      end;
      EndDoc;
    end;
  end;

end;

thanks :)

PostPosted: January 6th, 2005, 12:40 am
by dennis
hi
thank you very much

perhaps my question is obscurity

i am using Express FlowChart
the FlowChart do not provide the print function,
i want to print it use
can you help me ?

following URL is Express FlowChart suit
http://www.devexpress.com/Downloads/vcl/exflowchart/

PostPosted: January 11th, 2005, 9:20 am
by Stefan
You're asking the wrong person :)

Try using TSimpleGraph / TExtGraph instead. Information can be found on the product page of this site: http://www.delphiarea.com/products/simplegraph/

It has full support for your flowcharting and printing needs. Yes, all that, and it's free and opensource! :)

thanks:)

PostPosted: January 14th, 2005, 1:06 am
by dennis
thank you very much :wink: :wink:

i will try it :) :P :P

PostPosted: January 14th, 2005, 9:48 am
by Stefan
I recommend you keep an eye on the sourceforge page, as there will be an update there soon (as you can read in the news section on the site:
http://sourceforge.net/projects/extgraph )

Anyway good luck with it, and if you want to request any features or want to report a bug or simply tell us what you are using it for, we will be most grateful.

Cheers,
Stefan
[/url]