diff options
author | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2009-10-09 15:35:50 +0200 |
---|---|---|
committer | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2009-10-09 15:35:50 +0200 |
commit | 3b6721c900780b16bb032b8e59c1997c5fd12ddd (patch) | |
tree | 3a0053b6d52111c732d51cefcd516089f18ef784 /examples | |
parent | 441528ff12011732221996990d0a206e610649ed (diff) | |
download | fpGUI-3b6721c900780b16bb032b8e59c1997c5fd12ddd.tar.xz |
Canvas.DrawString() help.
The coordinates of DrawString is the top/left corner of the string.
So the actual text appears below y.
Diffstat (limited to 'examples')
-rw-r--r-- | examples/corelib/canvastest/fpgcanvas.lpi | 5 | ||||
-rw-r--r-- | examples/corelib/canvastest/fpgcanvas.lpr | 6 |
2 files changed, 8 insertions, 3 deletions
diff --git a/examples/corelib/canvastest/fpgcanvas.lpi b/examples/corelib/canvastest/fpgcanvas.lpi index 56117be1..66833b5b 100644 --- a/examples/corelib/canvastest/fpgcanvas.lpi +++ b/examples/corelib/canvastest/fpgcanvas.lpi @@ -1,15 +1,14 @@ <?xml version="1.0"?> <CONFIG> <ProjectOptions> - <PathDelim Value="/"/> - <Version Value="6"/> + <Version Value="7"/> <General> <Flags> <SaveOnlyProjectUnits Value="True"/> + <LRSInOutputDirectory Value="False"/> </Flags> <SessionStorage Value="InProjectDir"/> <MainUnit Value="0"/> - <IconPath Value="./"/> <TargetFileExt Value=""/> <Title Value="fpcanvas"/> </General> diff --git a/examples/corelib/canvastest/fpgcanvas.lpr b/examples/corelib/canvastest/fpgcanvas.lpr index 5db95e09..c5473ba9 100644 --- a/examples/corelib/canvastest/fpgcanvas.lpr +++ b/examples/corelib/canvastest/fpgcanvas.lpr @@ -92,6 +92,12 @@ begin y := 60; Canvas.SetTextColor(clBlack); Canvas.DrawString(5, y, 'This text must be black and default font (' + fpgApplication.DefaultFont.FontDesc + ')'); + + // red dot indicates top/left corner of where previous text was started + Canvas.Pixels[5,y] := clRed; +// Canvas.DrawLine(5,y-4, 5,y+5); +// Canvas.DrawLine(1,y, 10, y); + Canvas.SetTextColor(clRed); y := y + Canvas.Font.Height; // fonts are different sizes on differet OS's Canvas.DrawString(5, y, 'This text must be red.'); |