thePort
, call the Draw function as follows:
line.Draw( thePort );
Device dependency issues | ||
Because a system can have many different devices connected to it, at differing resolutions, you need to determine what device you want text to be idealized for. Many of the TTextLineLayout functions take a resolution in the form of a TGrafMatrix. | Generally you should create the TGrafMatrix based on a particular TGrafPort. A TGrafPort has a preferred resolution, set either by an end user or heuristically. However, nothing prevents you from passing a resolution that differs from the resolution of the TGrafPort. | Be aware that any time the resolution changes, TTextLineLayout may regenerate the line. TTextLineLayout always caches a line layout for a single resolution, allowing fast drawing to a single monitor or to multiple monitors of the same resolution. Regenerating the line is an expensive operation in terms of performance. |