I can write a text on Canvas, but the text can be longer than Canvas width.
Is there any function (or algorithm) in Delphi, which wraps text written on
the Canvas?
Thanks Bob
There is a Win32 API function, DrawText.
const
AlignFlags: array[TAlignment] of Integer = (DT_LEFT, DT_RIGHT, DT_CENTER);
var
MyFlags: Integer;
MyText: string;
MyRect: TRect;
MyAlignment:TAlignment;
MyCanvas: TCanvas;
MyFlags := AlignFlags[MyAlignment];
Windows.DrawText(MyCanvas.Handle, PChar(MyText), -1, MyRect, MyFlags);
--
Andrei Fomine.
Add full-blown clipboard and drag-and-drop capabilities to any control with
Transfer@once.
DbAltGrid allows multi-line layout and RTF text in a DBGrid descendant.
http://www.quasidata.com/
"Bob" <little...@seznam.cz> wrote in message news:3b80d2a3_1@dnews...
"Quasidata" <quasidata AT quasidata DOT com> wrote in message
news:3b80d86a_2@dnews...
You have to use an API function for this, DrawText (see win32.hlp). Pass it
the canvas.handle as first parameter. Search the newsgroup archives or the
VCL source for examples.
http://www.mers.com/searchsite.html
http://www.tamaracka.com/search.htm
http://groups.google.com
http://www.prolix.be
Peter Below (TeamB) 10011...@compuserve.com)
No e-mail responses, please, unless explicitly requested!
Note: I'm unable to visit the newsgroups every day at the moment,
so be patient if you don't get a reply immediately.
>There is a Win32 API function, DrawText.
>
>const
> AlignFlags: array[TAlignment] of Integer = (DT_LEFT, DT_RIGHT, DT_CENTER);
He rather needs
Const
WordWrap: array[Boolean] of Word = (DT_SINGLELINE, DT_WORDBREAK);
Manuel Algora
m...@encomix.es