Introduction
This example source code shows you how to call the print dialog and print the growth chart.
|
| Source code example |
procedure TMyApplication.BtnPrintClick(Sender: TObject);
//Print the current page by showing a print dialog
begin
if GrowthChart.PrinterSetup then
GrowthChart.Print;
end; |
|
Note!
In order to maintain a good print result of the gray lines used in the background we have implemented two alternative ways of rendering these. These options are available in the lower left corner of the Print dialog.
|
| Default |
Gray colors are printed as gray and the printer will do it's own conversion. This mode means that the
light gray lines are sometimes translated into dotted lines of different widths. In some cases the lines may even disappear completely. The
light gray lines may even come out as solid black. HP printers are particularly difficult with this option set to Default. |
| Dithered |
With this option set the growth chart
component will do the translation of light gray into a B&W pattern which looks like
light gray. The advantage of this mode over the Dotted is that the background appears somewhat lighter. |
| Dotted |
With this option set light gray lines will be printed using equally sized dots, approximately 0.5 mm long. This is the mode used by the original paper growth charts provided by Socialstyrelsen. |
Extended methods
All growth charts dating from 2002-02-11 and later have extended methods for customized printing.
You can use these methods if you want to
print or display the graph on a surface
other than the full A4 page. These methods are:
PrintEx(DC: Integer; Left: Integer; Top: Integer; Right: Integer; Bottom: Integer) - which draws the growth chart in the rectangle specified by Left, Top, Right, and Bottom, given the device context DC.
This method will draw the graph with the
rendering options described in the table
above. Note that you must have selected
the appropriate rendering method in
the PrinterSetup dialog specific for the
growth chart.
Draw(DC: Integer; Left: Integer; Top: Integer; Right: Integer; Bottom: Integer) - which does the same thing as PrintEx but without any special rendering for printers.
|