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

//声明:
PolyBezierTo(
  DC: HDC;      {设备环境句柄}
  const Points; {点数组}
  Count: DWORD  {数组元素个数}
): BOOL;

//需要给 PolyBezierTo 指定起始点 procedure TForm1.FormPaint(Sender: TObject); var ps: array[0..2] of TPoint; begin ps[0].X := 40; ps[0].Y := 110; ps[1].X := 80; ps[1].Y := 30; ps[2].X := 110; ps[2].Y := 70; MoveToEx(Canvas.Handle, 10,70, nil); PolyBezierTo(Canvas.Handle, ps, 3); end;
//效果图:

//PolyBezierTo 会更新当前位置
procedure TForm1.FormPaint(Sender: TObject);
var
  ps: array[0..2] of TPoint;
begin
  ps[0].X := 40;
  ps[0].Y := 110;
  ps[1].X := 80;
  ps[1].Y := 30;
  ps[2].X := 110;
  ps[2].Y := 70;
 
  MoveToEx(Canvas.Handle, 10,70, nil);
  PolyBezierTo(Canvas.Handle, ps, 3);

  {PolyBezierTo 已更新当前位置, 继续画}
  LineTo(Canvas.Handle, 110,10);
  LineTo(Canvas.Handle, 10,10);
  LineTo(Canvas.Handle, 10,70);
end;

//效果图:

posted on 2008-02-09 19:43  万一  阅读(...)  评论(...编辑  收藏