Calculate real TQRMemo Height on QuickReport

903 Views Asked by At

I have several memos with different font on QuickReport. Now I'd like to know the most bottom point for all (for set some shape below). How? If I calculate TextHeight for each and multiple by lines count (aMemo.ParentReport.TextHeight(aMemo.Font, 'W') * aMemo.Lines.Count), results are not correctly - QuickReport print lines like with strange height and position of my shape for some fonts are too high or too low.

1

There are 1 best solutions below

0
On BEST ANSWER

Ok, I got it. TextHeight cannot be call from QuickReport, but from Printer.Canvas. Then divide it by Y-Resolution for printer, next divide by 254 and multiple by 96. Result will be round and this is real value of Height of text in TQRMemo. All values are not accessible before print from QuickReport. It's very "smart" to return not real values based on same properties like during printing by component (by TQuickRep.TextHeight method).