PROCEDURE TFmMapBase.PrintMap(Map: TMap);
VAR
MyBlankFile: TextFile;
MyPrintDialog: TPrintDialog;
begin
MyPrintDialog := TPrintDialog.Create(Application);
MyPrintDialog.Options := [poPageNums, poSelection];
IF MyPrintDialog.Execute then
begin
map.PaperUnit := miPaperUnitMillimeter;
TRY
Printer.begin
Doc;
Map.PrintMap(Printer.Handle, 0, 0, Map.Width * 100, Map.Height * 100);
Printer.EndDoc;
EXCEPT
Printer.Abort;
MessageDlg('不能打印地图', mtError, [mbOK], 0);
end;
end;
MyPrintDialog.Free;
// MyPrintDialog.Destroy;
MyPrintDialog := NIL;