现在的位置: 首页 > 综合 > 正文

WinAPI: SetTextJustification – 设置两端对齐

2012年05月10日 ⁄ 综合 ⁄ 共 345字 ⁄ 字号 评论关闭
//声明:
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;
//效果图:



抱歉!评论已关闭.