随笔 - 2146  文章 - 97 评论 - 11767 trackbacks - 253

//声明:
SetTextJustification(
  DC: HDC;            {设备环境句柄}
  BreakExtra,         {宽度}
  BreakCount: Integer {被分成几份; 一般以空格为间隔}
): Integer;           {成功返回非 0 值; 失败返回 0}

//举例: procedure TForm1.FormPaint(Sender: TObject); const str = 'CodeGear Delphi 2007'; begin TextOut(Canvas.Handle, 1, 50, str, Length(str)); SetTextJustification(Canvas.Handle, ClientWidth, 3); TextOut(Canvas.Handle, 1, 80, str, Length(str)); end;
//效果图:

posted on 2008-02-08 21:17  万一  阅读(...)  评论(...编辑  收藏