Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

Printing complex line drawlings nicely

edited February 2002 in General
I have an object that draws a complex thing (well actually the night sky) on
a TCanvas. Using a bitmap "buffer" this is displayed on forms. I now need
to print/preview the things drawn as part of a report.

What is the best approach to doing this that will also allow for the higher
ppi resolution that most printers have? That is, a simple bitmap capture of
what is on the form will not do, even stretched it is ugly and too course.

I have ideas of drawing on a TMetafileCanvas (with printer resolution) and
playing that to a ppImage etc., but I was wondering if I have missed
something obvious. Would creating a printer 'equivalent' bitmap be a better
way to go? Could I somehow use the printer canvas itself?

Basically, what is the best way to use ReportBuilder with high quality line
drawings??

Thanks

Sarah

Comments

  • edited February 2002
    You can create TppDrawLine objects on a each page. The draw command
    positioning precision is measured in microns (thousandths of millimeters).
    It should look really good on the printer with this approach.

    Use the Report.OnEndPage event to add draw commands to the current page.

    uses
    ppDrwCmd;
    ..
    procedure ...
    var
    lDrawLine: TppDrawLine
    begin
    lDrawLine := TppDrawLine.Create(nil);
    lDrawLine.Page := ppReport1.Engine.Page;
    lDrawLine.LinePosition := lpLeft;
    lDrawLine.Left := ppReport1.PrinterSetup.PageDef.mmMarginLeft;
    lDrawLine.Top := ppReport1.Engine.PrintPosRect.Top;
    lDrawLine.Height := 50800;
    end;



    Cheers,

    Jim Bennett
    Digital Metaphors


This discussion has been closed.