Function TWPRTFEngineBasis.MeasureObject(MeasureObjectMode:TWPMeasureObjectMode; Par:TParagraph; posinpar:Integer; PageNumber:Integer; xoff:Integer; maxx:Integer; YOff:Integer; maxy:Integer; curr_page:TWPVirtPage; w:Integer; h:Integer; PaintObject:TWPTextObj; PaintCanvas:TCanvas; SectionID:Integer; LockWidth:Boolean) : WideString

Unit: WPRTEDefs
Class: WPRTEDefs.TWPRTFEngineBasis

Parameters

  • MeasureObjectMode:TWPMeasureObjectMode
  • Par:TParagraph
  • posinpar:Integer
  • PageNumber:Integer
  • xoff:Integer
  • maxx:Integer
  • YOff:Integer
  • maxy:Integer
  • curr_page:TWPVirtPage
  • w:Integer
  • h:Integer
  • PaintObject:TWPTextObj
  • PaintCanvas:TCanvas
  • SectionID:Integer
  • LockWidth:Boolean

Returns

The type of the result value is WideString.

Description

This function measures the text object or prepares the drawing. It first tries to do the work itself and then triggers the 'OnMeasureObject' event. It is called during Reformat and Repaint. If the PaintObject variable is set to 0 the result string is painted using the attributes at the given position which are evaluated after the call to MeasureObject - so it is possible to update the CharAttr. Please note that the resulting text is not buffered - so please take care that the text is the same at reformat and paint time or at least fits into the width which was calculated at reformat time